/* OTAKIROKU USER PROFILE v8 - AniList-Style Header */

/* ===== CONTENT AREA LOADING ===== */
/* Header loads instantly, content area shows spinner until data is ready */

.profile-content-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    min-height: 300px;
}

.profile-content-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary, #a855f7);
    border-radius: 50%;
    animation: profileSpin 0.8s linear infinite;
}

.profile-content-loader .loader-text {
    margin-top: 16px;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.9rem;
}

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

/* Hide main content while loading, show loader */
.profile-main.loading > *:not(.profile-content-loader) {
    display: none !important;
}

.profile-main:not(.loading) > .profile-content-loader {
    display: none;
}

/* Reveal animation when content loads */
.profile-main.loaded > * {
    animation: contentReveal 0.3s ease-out;
}

@keyframes contentReveal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== NAVBAR TRANSPARENCY (User Page Only) ===== */
.navbar {
    background: rgba(30, 30, 46, 0.7);
    transition: background 0.6s ease;
}

.navbar:hover,
.navbar.scrolled {
    background: var(--bg-surface);
}

/* Frame button transparency when navbar is translucent */
.navbar .user-nav-btn.has-frame:not(.frame-gradient):not(.frame-animated) {
    background: rgba(30, 30, 46, 0.6);
    transition: background 0.6s ease, border-color 0.6s ease;
}

.navbar:hover .user-nav-btn.has-frame:not(.frame-gradient):not(.frame-animated),
.navbar.scrolled .user-nav-btn.has-frame:not(.frame-gradient):not(.frame-animated) {
    background: var(--bg-elevated);
}

/* ===== USER BANNER ===== */
.user-banner {
    position: relative;
    z-index: 1;
    height: 340px;
    margin-top: -54px;
    padding-top: 54px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
    background-size: cover;
    background-position: center 30%;
    overflow: hidden;
    box-sizing: border-box;
}

/* ===== SPOTLIGHT (behind banner on z-axis) ===== */
.profile-info-bar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80%;
    background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(var(--primary-rgb), 0.22), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ===== PROFILE INFO BAR (Below Banner) ===== */
.profile-info-bar {
    position: relative;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    z-index: 20;
}

/* Accent color override — when --user-accent is set via JS */
.profile-info-bar[style*="--user-accent"]::before {
    background: radial-gradient(ellipse 100% 80% at 50% 0%, color-mix(in srgb, var(--user-accent) 22%, transparent), transparent 70%);
}

.profile-info-bar[style*="--user-accent"] .profile-tab-btn.active {
    color: var(--user-accent);
    border-color: var(--user-accent);
}

.profile-info-bar[style*="--user-accent"] .profile-stat-value {
    color: var(--user-accent);
}

.profile-info-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 0 0px;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 70px;
    position: relative;
}

/* Inline Tabs - Absolutely centered */
.profile-tabs-inline {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-tabs-inline .profile-tab {
    position: relative;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-tabs-inline .profile-tab:hover {
    color: var(--text-primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.profile-tabs-inline .profile-tab.active {
    color: var(--primary);
    background: var(--primary-subtle);
}

/* Tab icons - hidden on desktop by default, shown on mobile */
.profile-tabs-inline .profile-tab {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-tabs-inline .profile-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: none; /* Hidden on desktop */
}

/* Avatar Wrapper - positions avatar to overlap banner */
.profile-avatar-wrap {
    position: relative;
    margin-top: -80px;
    flex-shrink: 0;
}

.user-avatar {
    width: 150px;
    height: 150px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Avatar with frame enabled */
.user-avatar.has-frame {
    background: var(--bg-elevated);
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

.user-avatar svg {
    width: 50px;
    height: 50px;
    color: var(--text-muted);
}

/* Profile Main Info */
.profile-info-main {
    flex: 1;
    min-width: 0;
}

.profile-info-main h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Social Stats (Followers/Following) */
.profile-social-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.social-stat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.social-stat-btn:hover {
    background: var(--bg-elevated);
}

.social-stat-btn .stat-count {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.social-stat-btn .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.follow-actions {
    display: flex;
    gap: 8px;
}

/* Sign out button */
.btn-signout {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-signout svg {
    width: 18px;
    height: 18px;
}

.btn-signout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Tablet: Hide some tabs */
@media (max-width: 900px) {
    .profile-tabs-inline .profile-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Mobile: Stack elements */
@media (max-width: 700px) {
    .profile-tabs-inline {
        position: relative;
        left: auto;
        transform: none;
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 2px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .profile-tabs-inline .profile-tab {
        flex-shrink: 0;
        padding: 6px 12px;
    }

    .profile-social-stats {
        margin-left: 0;
    }
}

/* Mobile: Stack follower stats below username on small screens */
@media (max-width: 550px) {
    .profile-info-content {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }

    .profile-avatar-wrap {
        margin-top: -60px;
    }

    .user-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-info-main {
        order: 0;
        flex: 1;
    }

    .profile-social-stats {
        order: 1;
    }

    .profile-tabs-inline {
        order: 3;
        padding-left: 0;
        margin-top: 4px;
    }

    .profile-actions {
        order: 2;
    }

    .social-stat-btn {
        flex-direction: row;
        gap: 6px;
        padding: 4px 0;
    }

    .social-stat-btn .stat-count {
        font-size: 0.95rem;
    }

    .social-stat-btn .stat-label {
        font-size: 0.75rem;
        text-transform: none;
    }

    .profile-actions {
        order: 1;
        margin-left: auto;
    }
}

/* ===== PROFILE NAV ===== */
/* Old profile-nav removed - tabs are now inline */

/* ===== MAIN ===== */
.profile-main { max-width: 1400px; margin: 0 auto; padding: 24px 24px 60px; }
.tab-content { display: none; animation: fadeIn 0.25s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== OVERVIEW SKELETONS ===== */
/* Shimmer animation for loading states */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-shimmer {
    background: linear-gradient(110deg,
        rgba(255,255,255,0.03) 30%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.03) 70%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Skeleton for stat values */
.overview-stat-value.loading {
    min-width: 40px;
    height: 1.6rem;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    color: transparent;
}

.overview-stat-value.loading::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton for genre bars */
.genre-bars-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.genre-bar-skeleton {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
}

.genre-bar-skeleton .skel-name {
    width: 60px;
    height: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
}

.genre-bar-skeleton .skel-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    overflow: hidden;
}

.genre-bar-skeleton .skel-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: var(--skel-width, 60%);
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

.genre-bar-skeleton .skel-count {
    width: 20px;
    height: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
}

/* Skeleton for activity graph */
.activity-graph-skeleton {
    display: flex;
    gap: 2px;
    padding: 8px;
}

.activity-week-skeleton {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-day-skeleton {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 2px;
}

/* Skeleton for recent activity */
.recent-activity-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item-skeleton {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.activity-item-skeleton .skel-cover {
    width: 40px;
    height: 56px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    flex-shrink: 0;
}

.activity-item-skeleton .skel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-item-skeleton .skel-title {
    height: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    width: 80%;
}

.activity-item-skeleton .skel-meta {
    height: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    width: 50%;
}

/* Skeleton for favorites grid */
.favorites-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.favorite-skeleton {
    aspect-ratio: 2/3;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
}

/* Hide skeleton when data is loaded */
.has-data .overview-stat-value.loading,
.has-data .genre-bars-skeleton,
.has-data .activity-graph-skeleton,
.has-data .recent-activity-skeleton,
.has-data .favorites-skeleton {
    display: none;
}

/* Fade in content when loaded */
.overview-fade-in {
    animation: fadeIn 0.3s ease;
}

/* ===== OVERVIEW TAB ===== */

/* Stats Row */
.overview-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.overview-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    transition: all 0.25s ease;
}

.overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.12);
    border-color: var(--primary);
}

.overview-stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}

.overview-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* About Panel - fixed height to match favorites */
.about-panel {
    margin-bottom: 0;
}

.overview-top-three .about-panel .about-content {
    flex: 1;
    overflow-y: auto;
}

/* Favorites panel - fixed height for 3 rows, scrolls if more */
.overview-top-three #favoritesPanel {
    height: 520px;
    min-height: 520px;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.7) rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar for favorites - webkit */
.overview-top-three #favoritesPanel::-webkit-scrollbar {
    width: 8px;
}

.overview-top-three #favoritesPanel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.overview-top-three #favoritesPanel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), #7c3aed);
    border-radius: 4px;
}

.overview-top-three #favoritesPanel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a78bfa, var(--primary));
}

.about-panel .about-content {
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Top Three Row: About, Favorites, Recent Activity */
.overview-top-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.overview-top-three > .panel {
    display: flex;
    flex-direction: column;
    height: 520px;
    min-height: 520px;
    max-height: 520px;
}

/* Adjust columns based on what's visible */
.overview-top-three:has(#aboutSection:not([style*="display: none"])):has(#favoritesPanel:not([style*="display: none"])) {
    grid-template-columns: 1fr 1fr 1fr;
}

.overview-top-three:has(#aboutSection[style*="display: none"]):has(#favoritesPanel[style*="display: none"]) .recent-activity-panel {
    grid-column: span 3;
}

.overview-top-three:has(#aboutSection[style*="display: none"]):has(#favoritesPanel:not([style*="display: none"])) {
    grid-template-columns: 1fr 1fr;
}

.overview-top-three:has(#aboutSection:not([style*="display: none"])):has(#favoritesPanel[style*="display: none"]) {
    grid-template-columns: 1fr 1fr;
}

/* Recent activity - no scroll, matches favorites height */
.recent-activity-panel .activity-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
}

.overview-top-three .recent-activity-panel .activity-item {
    flex: 1;
    min-height: 50px;
}

/* Favorites in top row - smaller grid */
.overview-top-three #favoritesPanel .favorites-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

/* Bottom Row: Genres & Activity History */
.overview-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

/* Legacy - Favorites & Genres Split Row */
.overview-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.overview-top-row .panel {
    flex: 1;
}

/* When favorites is hidden, genres takes full width */
.overview-top-row .panel.full-width {
    grid-column: span 2;
}

/* Smaller favorites grid when in split view */
.overview-top-row .favorites-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

/* Activity Graph */
.activity-graph {
    display: grid;
    grid-template-columns: repeat(26, 1fr);
    gap: 3px;
}

.activity-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.activity-day {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
}

/* Heat map levels - progressively more intense purple */
.activity-day[data-level="1"] {
    background: rgba(var(--primary-rgb), 0.3);
    border-color: rgba(var(--primary-rgb), 0.4);
}
.activity-day[data-level="2"] {
    background: rgba(var(--primary-rgb), 0.5);
    border-color: rgba(var(--primary-rgb), 0.6);
}
.activity-day[data-level="3"] {
    background: rgba(var(--primary-rgb), 0.75);
    border-color: rgba(var(--primary-rgb), 0.85);
}
.activity-day[data-level="4"] {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 4px rgba(var(--primary-rgb), 0.5);
}

/* Only show hover effect on active days */
.activity-day[data-level="1"]:hover,
.activity-day[data-level="2"]:hover,
.activity-day[data-level="3"]:hover,
.activity-day[data-level="4"]:hover {
    transform: scale(1.4);
    box-shadow: 0 0 8px var(--primary);
    cursor: pointer;
}

/* Custom tooltip */
.activity-tooltip {
    position: fixed;
    display: none;
    background: #1a1a22;
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 8px 12px;
    z-index: 9999;
    pointer-events: none;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.activity-tooltip strong {
    display: block;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.activity-tooltip span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 2px;
}

.stats-summary-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.stats-summary-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stats-progress-bar {
    position: relative;
    height: 6px;
    background: var(--bg-deep);
    border-radius: 4px;
    overflow: visible;
}

.stats-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stats-progress-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 5%;
    font-size: 0.65rem;
    color: var(--text-tertiary);
}

/* Activity Panel */
.activity-panel {
    flex: 1;
}

/* Favorites Section */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.favorite-card {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.favorite-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.favorite-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 8px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.favorite-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* List Type Switcher */
.list-type-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.list-type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-type-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.list-type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.list-type-btn svg {
    width: 18px;
    height: 18px;
}

.list-type-count {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 0.75rem;
}

.list-type-btn:not(.active) .list-type-count {
    background: var(--bg-elevated);
}

.list-type-view {
    display: none;
}

.list-type-view.active {
    display: block;
}

/* Inline Create List Button */
.btn-create-list-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    margin-left: auto;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-create-list-inline:hover {
    background: var(--primary-hover);
}

.btn-create-list-inline svg {
    width: 16px;
    height: 16px;
}

/* ===== CUSTOM LISTS SECTION - REDESIGNED ===== */

/* Create List Button */
.btn-create-list {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-create-list:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-create-list svg {
    width: 16px;
    height: 16px;
}

/* Custom Lists Container - supports grid and list views */
.custom-lists-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Grid view for custom lists container */
.custom-lists-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-items: start; /* Prevent cards from stretching to match tallest in row */
}

/* Custom List Card */
.custom-list-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.2s ease;
    overflow: hidden;
}

/* Grid view card adjustments */
.custom-lists-grid.grid-view .custom-list-card {
    min-height: 100px;
}

.custom-lists-grid.grid-view .list-card-header {
    padding: 14px 16px;
}

.custom-lists-grid.grid-view .list-card-icon {
    width: 40px;
    height: 40px;
}

.custom-lists-grid.grid-view .list-card-icon svg {
    width: 20px;
    height: 20px;
}

/* Responsive grid view */
@media (max-width: 600px) {
    .custom-lists-grid.grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .custom-lists-grid.grid-view .list-card-header {
        padding: 10px 12px;
        gap: 10px;
    }

    .custom-lists-grid.grid-view .list-card-icon {
        width: 32px;
        height: 32px;
    }

    .custom-lists-grid.grid-view .list-card-icon svg {
        width: 16px;
        height: 16px;
    }

    .custom-lists-grid.grid-view .list-name {
        font-size: 0.8rem;
    }

    .custom-lists-grid.grid-view .list-count {
        font-size: 0.7rem;
    }

    .custom-lists-grid.grid-view .list-card-actions {
        display: none;
    }
}

.custom-list-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.custom-list-card.hidden-entry {
    opacity: 0.7;
}

.custom-list-card.hidden-entry:hover {
    opacity: 0.9;
}

/* Card Header */
.list-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.list-card-header:hover {
    background: rgba(var(--primary-rgb), 0.03);
}

/* List Icon */
.list-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--primary-rgb), 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-card-icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

/* List Info */
.list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Visibility Indicator */
.list-visibility {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-visibility svg {
    width: 14px;
    height: 14px;
}

.list-visibility.public {
    color: var(--primary);
    opacity: 0.6;
}

.list-visibility.private {
    color: #ef4444;
    opacity: 1;
}

/* Card Actions */
.list-card-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-list-card:hover .list-card-actions {
    opacity: 1;
}

.list-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.list-action-btn:hover {
    background: var(--primary);
    color: white;
}

.list-action-btn.danger:hover {
    background: var(--danger);
}

.list-action-btn svg {
    width: 15px;
    height: 15px;
}

/* Expand Button */
.list-expand-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.list-expand-btn:hover {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
}

.list-expand-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

.custom-list-card.expanded .list-expand-btn {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
}

.custom-list-card.expanded .list-expand-btn svg {
    transform: rotate(180deg);
}

/* Expanded Content */
.list-expanded-content {
    display: none;
    width: 100%;
}

.custom-list-card.expanded .list-expanded-content {
    display: block;
    padding: 0 18px 18px;
    animation: slideDown 0.25s ease;
}

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

/* Anime Grid inside expanded content */
.list-anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 14px;
}

.list-anime-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    position: relative;
}

.list-anime-item:hover {
    transform: translateY(-4px);
}

.list-anime-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-deep);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.list-anime-item:hover img {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.list-anime-edit {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s ease;
    z-index: 2;
}

.list-anime-edit svg {
    width: 14px;
    height: 14px;
    color: white;
}

.list-anime-item:hover .list-anime-edit {
    opacity: 1;
}

.list-anime-edit:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Visibility badge for anime in custom lists */
.list-anime-visibility {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.list-anime-visibility svg {
    width: 12px;
    height: 12px;
}

.list-anime-visibility.hidden {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.list-anime-visibility.public {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.list-anime-item.hidden-anime {
    opacity: 0.5;
}

.list-anime-item.hidden-anime img {
    filter: grayscale(40%);
}

.list-anime-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* Loading/Error/Empty states */
.list-loading,
.list-error,
.list-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.list-error {
    color: var(--danger);
}

.empty-lists-msg {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

.empty-lists-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 16px;
}

.empty-lists-state svg {
    width: 48px;
    height: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-lists-state h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--text);
}

.empty-lists-state p {
    margin: 0 0 20px;
    color: #9ca3af;
    font-size: 0.9rem;
    max-width: 300px;
}

.btn-create-first {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-create-first:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-create-first svg {
    width: 18px;
    height: 18px;
    margin: 0;
    opacity: 1;
}

/* Custom List Modal */
.custom-list-modal {
    max-width: 400px;
}

.custom-list-modal .form-group {
    margin-bottom: 16px;
}

.custom-list-modal label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 500;
}

.custom-list-modal input[type="text"],
.custom-list-modal textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.custom-list-modal input[type="text"]:focus,
.custom-list-modal textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-group {
    margin-top: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}
.overview-left, .overview-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 900px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.25s ease;
}
.panel:hover {
    border-color: var(--primary);
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.panel-header .panel-title {
    margin-bottom: 0;
}
.panel-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 16px;
}
.panel-link {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    transition: color 0.2s ease;
}
.panel-link:hover {
    color: var(--primary-hover);
}
.panel-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 4px 10px;
    border-radius: 10px;
}

/* Status Distribution */
.status-bar-container {
    margin-bottom: 16px;
}
.status-bar {
    height: 8px;
    background: var(--bg-deep);
    border-radius: 6px;
    display: flex;
    overflow: hidden;
    transition: height 0.3s ease;
}
.status-bar.expanded {
    height: 12px;
}
.status-segment {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.status-segment.watching { background: #60a5fa; }
.status-segment.completed { background: #4ade80; }
.status-segment.on-hold { background: #fbbf24; }
.status-segment.dropped { background: #f87171; }
.status-segment.planned { background: var(--primary-light); }
.status-segment.highlighted {
    filter: brightness(1.2);
    transform: scaleY(1.2);
    z-index: 2;
}
.status-segment.dimmed {
    filter: brightness(0.5) saturate(0.5);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-deep);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.status-item:hover {
    background: var(--bg-hover);
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.status-item.watching .status-dot { background: #60a5fa; }
.status-item.completed .status-dot { background: #4ade80; }
.status-item.on-hold .status-dot { background: #fbbf24; }
.status-item.dropped .status-dot { background: #f87171; }
.status-item.planned .status-dot { background: var(--primary-light); }
.status-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.status-item:hover .status-name {
    color: var(--text-primary);
}
.status-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}
.status-item.highlighted {
    background: var(--bg-hover);
}
.status-item.dimmed {
    opacity: 0.4;
}

/* Genre Overview */
.genre-bar-visual {
    height: 6px;
    background: var(--bg-deep);
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    margin-bottom: 14px;
    transition: height 0.3s ease;
}
.genre-bar-visual.expanded {
    height: 10px;
}
.genre-bar-segment {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.genre-bar-segment.highlighted {
    filter: brightness(1.2);
    transform: scaleY(1.3);
}
.genre-bar-segment.dimmed {
    filter: brightness(0.5) saturate(0.5);
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.genre-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-left: 3px solid var(--tag-color);
    border-radius: 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.genre-tag:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-color: var(--tag-color);
}
.genre-tag-name {
    color: var(--text-primary);
    font-weight: 600;
}
.genre-tag:hover .genre-tag-name {
    color: var(--tag-color);
}
.genre-tag-count {
    color: var(--tag-color);
    font-weight: 700;
    font-size: 0.7rem;
}
.genre-tag.highlighted {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.genre-tag.dimmed {
    opacity: 0.35;
}

/* Compact horizontal genre bars */
.genre-bars-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.genre-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.genre-bar-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.genre-bar-row:hover .genre-bar-name {
    color: var(--primary);
}

.genre-bar-row:hover .genre-bar-track {
    height: 8px;
}

.genre-bar-row:hover .genre-bar-fill {
    filter: brightness(1.2);
    box-shadow: 0 0 8px currentColor;
}

.genre-bar-row:hover .genre-bar-count {
    color: var(--text-primary);
}

.genre-bar-name {
    width: 80px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.genre-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-deep);
    border-radius: 4px;
    overflow: hidden;
    transition: height 0.2s ease;
}

.genre-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease, box-shadow 0.2s ease;
}

.genre-bar-fill.animate-fill {
    width: 0 !important;
}

.genre-bar-count {
    width: 28px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

/* Score Line Graph - Canvas based */
.score-line-graph {
    position: relative;
}
.score-line-canvas {
    width: 100%;
    height: 120px;
    display: block;
}
.score-line-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
}
.score-line-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 2;
}
.score-line-dot.highlighted {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 0 12px var(--primary);
}
.score-line-dot.dimmed {
    opacity: 0.25;
    transform: translate(-50%, -50%) scale(0.8);
}
.score-line-zones {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    display: flex;
    padding: 0 5%;
}
.score-line-zone {
    flex: 1;
    cursor: pointer;
}
.score-line-tooltip {
    position: absolute;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translate(-50%, calc(-100% - 24px));
}
.score-line-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}
.score-line-tooltip::before {
    content: '';
    position: absolute;
    top: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--bg-elevated);
    z-index: 1;
}
.score-line-tooltip.visible {
    opacity: 1;
}
.score-line-labels {
    display: flex;
    margin-top: 8px;
    padding: 0 5%;
}
.score-line-label {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.score-line-label:hover,
.score-line-label.highlighted {
    color: var(--primary);
    font-weight: 600;
}
.score-line-label.dimmed {
    opacity: 0.3;
}

/* Stats section variant */
.stats-score-graph .score-line-canvas { height: 140px; }
.stats-score-graph .score-line-dots { height: 140px; }
.stats-score-graph .score-line-zones { height: 140px; }

/* Right Side Panels */
.watching-list,
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.watching-item,
.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-deep);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.watching-item:hover,
.activity-item:hover {
    background: var(--bg-hover);
}
.watching-item img,
.activity-cover {
    width: 36px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.watching-info,
.activity-info {
    flex: 1;
    min-width: 0;
}
.watching-title,
.activity-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.watching-progress-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}
.watching-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}
.watching-eps {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}
.btn-plus {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-subtle);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-plus:hover {
    background: var(--primary);
    color: white;
}
.activity-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-tertiary);
}
.activity-date {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}
.activity-fav {
    color: #ef4444;
    font-size: 0.85rem;
}
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: 4px;
}
.status-badge.watching {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}
.status-badge.completed {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}
.status-badge.plan-to-watch {
    background: rgba(167, 139, 250, 0.15);
    color: var(--primary-light);
}
.status-badge.on-hold {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}
.status-badge.dropped {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
.status-badge.unlisted { background: rgba(107,114,128,0.15); color: #9ca3af; }
.status-badge.rewatching { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.status-badge.favorited { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.empty-msg { padding: 20px; text-align: center; color: #9ca3af; font-size: 0.8rem; }

/* ===== ANIME LIST TAB ===== */
.list-controls-bar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 12px; gap: 12px; }
.list-actions { display: flex; align-items: center; gap: 10px; }
.status-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.list-search { position: relative; width: 180px; flex-shrink: 0; margin-left: auto; }
.list-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #9ca3af; }
.list-search-input { width: 100%; padding: 8px 10px 8px 32px; font-size: 0.8rem; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; white-space: nowrap; overflow: hidden; cursor: text; line-height: 1.4; min-height: 33px; font-family: inherit; }
.list-search-input:focus { outline: none; border-color: var(--primary); }
.list-search-input:empty::before { content: attr(data-placeholder); color: #9ca3af; pointer-events: none; }
.list-sort select { padding: 8px 28px 8px 12px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); background: var(--bg-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 8px center; background-size: 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; appearance: none; -webkit-appearance: none; }
.list-sort select:hover { border-color: var(--primary); color: var(--text-primary); }
.list-sort select:focus { outline: none; border-color: var(--primary); }
.list-view-toggle { display: flex; gap: 4px; padding: 3px; background: var(--bg-surface); border-radius: 8px; }

/* More Menu Dropdown */
.list-more-menu { position: relative; }
.more-menu-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.more-menu-btn svg { width: 18px; height: 18px; }
.more-menu-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-subtle); }
.more-menu-dropdown { position: absolute; top: 100%; right: 0; margin-top: 6px; min-width: 180px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); z-index: 100; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s; }
.more-menu-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.more-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); background: none; border: none; cursor: pointer; transition: all 0.15s; text-align: left; }
.more-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.more-menu-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.more-menu-item:first-child { border-radius: 9px 9px 0 0; }
.more-menu-item:last-child { border-radius: 0 0 9px 9px; }
.more-menu-item.danger { color: var(--danger); }
.more-menu-item.danger:hover { background: rgba(239,68,68,0.1); }
.more-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.view-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 6px; color: #9ca3af; cursor: pointer; }
.view-btn svg { width: 16px; height: 16px; }
.view-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.view-btn.active { background: var(--primary); color: white; }
.status-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; }
.status-tab { display: flex; align-items: center; gap: 5px; padding: 8px 14px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.status-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.status-tab.active { color: var(--primary); background: var(--primary-subtle); border-color: rgba(var(--primary-rgb),0.3); }
.tab-count { padding: 2px 7px; font-size: 0.7rem; font-weight: 700; background: var(--bg-hover); border-radius: 8px; }
.status-tab.active .tab-count { background: rgba(var(--primary-rgb),0.2); color: var(--primary); }
.anime-list { display: flex; flex-direction: column; gap: 12px; }
.list-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 50px 20px; text-align: center; }
.list-empty svg { width: 50px; height: 50px; color: #9ca3af; opacity: 0.4; }
.list-empty p { font-size: 0.9rem; color: var(--text-secondary); }
.btn-browse { padding: 10px 22px; font-size: 0.85rem; font-weight: 600; color: white; background: var(--primary); border-radius: 10px; }

/* === ENHANCED LIST VIEW === */
.list-item {
    position: relative;
    display: grid;
    grid-template-columns: 85px 1fr auto;
    gap: 16px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.25s ease;
}
.list-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.1);
    transform: translateY(-2px);
}

/* Cover with status overlay */
.item-cover {
    position: relative;
    width: 85px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}
.item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.list-item:hover .item-cover img {
    transform: scale(1.05);
}

/* Info section */
.item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 6px;
}

/* Header with title and format */
.item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.item-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    transition: color 0.2s;
}
.item-title:hover {
    color: var(--primary);
}
.item-format {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Meta row with status, year and episode count */
.item-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #9ca3af;
}
.item-meta-row .status-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
}
.item-year {
    display: flex;
    align-items: center;
    gap: 4px;
}
.item-eps-total {
    color: var(--text-secondary);
}

/* Stats row matching series card style */
.item-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 4px;
}
.item-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.item-stat-value {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.item-stat-label {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.item-stat.rewatch .item-stat-value {
    color: var(--primary);
}

/* Progress bar */
.item-progress-bar {
    height: 5px;
    background: var(--bg-hover);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}
.item-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Notes */
.item-notes {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.4;
    font-style: italic;
}
.item-notes svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.6;
}
.item-notes span {
    word-break: break-word;
}

/* Actions column */
.item-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-increment, .btn-edit {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-increment svg, .btn-edit svg {
    width: 18px;
    height: 18px;
}
.btn-increment:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}
.btn-edit:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: scale(1.05);
}
/* ===== Grid View (uses .oku-card from shared style.css) ===== */
.anime-grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px; overflow: visible; }
.oku-card-wrapper { cursor: pointer; position: relative; }
.oku-card-wrapper.hidden-entry { opacity: 0.5; }
.oku-card-wrapper.selected { outline: 2px solid var(--primary); border-radius: 10px; }

/* Progress bar on card image */
.user-card-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 5px; background: rgba(0,0,0,0.7); z-index: 4; }
.user-card-progress .progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); box-shadow: 0 0 8px var(--primary); }

/* Edit button in slide-out */
.user-card-edit-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; background: var(--primary); border: none; border-radius: 6px; color: white; font-size: 0.75rem; font-weight: 600; cursor: pointer; margin-top: 0.25rem; }
.user-card-edit-btn svg { width: 14px; height: 14px; }

/* ===== STATISTICS TAB ===== */
.stats-section { margin-bottom: 28px; }
.stats-section-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.stats-section-title::before { content: ''; width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }

/* Overview Layout - Row-based system */
.stats-row { margin-bottom: 20px; }
.stats-row:last-child { margin-bottom: 0; }

.primary-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.primary-stats .stat-box { padding: 20px 16px; }
.primary-stats .stat-box-value { font-size: 1.75rem; }

.charts-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.charts-row .stats-card { min-height: 220px; }

.donuts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.donut-card { text-align: center; }
.donut-card h4 { text-align: center; margin-bottom: 12px; }

.patterns-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.secondary-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.secondary-stats .stat-box { padding: 14px 12px; }
.secondary-stats .stat-box-value { font-size: 1.25rem; }
.secondary-stats .stat-box-label { font-size: 0.65rem; }

.time-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.social-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

/* Series Stats - Clean Layout */
.series-overview-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.series-details-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; }

/* Series Progress Panels with Circular Rings */
.series-progress-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.25s ease;
}
.series-progress-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.series-progress-panel.purple { border-color: rgba(var(--primary-rgb), 0.3); background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, transparent 100%); }
.series-progress-panel.teal { border-color: rgba(20, 184, 166, 0.3); background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, transparent 100%); }
.series-progress-panel.purple:hover { border-color: rgba(var(--primary-rgb), 0.5); box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.15); }
.series-progress-panel.teal:hover { border-color: rgba(20, 184, 166, 0.5); box-shadow: 0 8px 24px rgba(20, 184, 166, 0.15); }

.progress-ring-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.progress-ring-bg {
    fill: none;
    stroke: var(--bg-deep);
    stroke-width: 6;
}
.progress-ring-fill {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 213.6;
    transition: stroke-dashoffset 0.6s ease;
}
.series-progress-panel.purple .progress-ring-fill { stroke: #8b5cf6; }
.series-progress-panel.teal .progress-ring-fill { stroke: #14b8a6; }

.progress-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-panel-info { flex: 1; }
.progress-panel-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.series-progress-panel.purple .progress-panel-info h4 { color: var(--primary-light); }
.series-progress-panel.teal .progress-panel-info h4 { color: #2dd4bf; }

.progress-panel-stats {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.progress-panel-stats span { font-weight: 600; }
.progress-panel-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.progress-panel-meta strong { color: var(--text-secondary); }

.series-ranking-card { padding: 16px; }
.series-ranking-card h4 { margin-bottom: 12px; }
.series-ranking-list { display: flex; flex-direction: column; gap: 6px; }

/* Section Headers */
.stats-section-header {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 32px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.stats-section-header:first-of-type {
    margin-top: 24px;
}

.stats-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.stats-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stats-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.stat-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; transition: all 0.25s ease; cursor: default; }
.stat-box:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); border-color: var(--primary); }
.stat-box:hover .stat-box-value { transform: scale(1.1); }
.stat-box-value { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; transition: transform 0.25s ease; }
.stat-box-label { font-size: 0.7rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.03em; transition: color 0.25s ease; }
.stat-box:hover .stat-box-label { color: var(--text-secondary); }

.stats-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; transition: all 0.25s ease; }
.stats-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); transform: translateY(-2px); }
.stats-card.full-width { grid-column: 1 / -1; }
.stats-card h4 { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; transition: color 0.25s ease; }
.stats-card:hover h4 { color: var(--primary); }

.donut-wrap { display: flex; justify-content: center; position: relative; margin-bottom: 14px; }
.donut-wrap canvas { cursor: default; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--text-primary); pointer-events: none; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; }
.dleg { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; padding: 4px 8px; margin: -4px -8px; border-radius: 6px; transition: all 0.2s ease; cursor: default; }
.dleg:hover { background: var(--bg-hover); transform: translateX(4px); }
.dleg-dot { width: 10px; height: 10px; border-radius: 3px; transition: transform 0.2s ease; }
.dleg:hover .dleg-dot { transform: scale(1.3); }
.dleg-name { flex: 1; color: var(--text-secondary); transition: color 0.2s ease; }
.dleg:hover .dleg-name { color: var(--text-primary); }
.dleg-val { font-weight: 700; color: var(--text-primary); }

.score-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.sbar { display: flex; align-items: center; gap: 8px; padding: 3px 6px; margin: -3px -6px; border-radius: 6px; transition: all 0.2s ease; cursor: default; }
.sbar:hover { background: var(--bg-hover); }
.sbar-l { width: 18px; font-size: 0.75rem; font-weight: 700; color: #9ca3af; text-align: right; transition: color 0.2s ease; }
.sbar:hover .sbar-l { color: var(--primary); }
.sbar-t { flex: 1; height: 14px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; transition: all 0.2s ease; }
.sbar:hover .sbar-t { height: 18px; }
.sbar-f { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 4px; transition: all 0.4s ease; }
.sbar:hover .sbar-f { filter: brightness(1.15); }
.sbar-v { width: 18px; font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); text-align: right; transition: all 0.2s ease; }
.sbar:hover .sbar-v { color: var(--text-primary); transform: scale(1.1); }
.score-meta { display: flex; gap: 16px; font-size: 0.75rem; color: var(--text-secondary); padding-top: 10px; border-top: 1px solid var(--border); }
.score-meta strong { color: var(--text-primary); }

.score-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.score-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    padding: 1px 0;
}

.score-legend-range {
    min-width: 36px;
    font-weight: 600;
    color: var(--primary);
}

.score-legend-label {
    color: #9ca3af;
}

.status-scores { display: flex; flex-direction: column; gap: 8px; }
.sbs { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; padding: 4px 8px; margin: -4px -8px; border-radius: 6px; transition: all 0.2s ease; cursor: default; }
.sbs:hover { background: var(--bg-hover); transform: translateX(4px); }
.sbs-dot { width: 10px; height: 10px; border-radius: 3px; transition: transform 0.2s ease; }
.sbs:hover .sbs-dot { transform: scale(1.3); }
.sbs-name { flex: 1; color: var(--text-secondary); transition: color 0.2s ease; }
.sbs:hover .sbs-name { color: var(--text-primary); }
.sbs-val { font-weight: 700; color: var(--text-primary); transition: transform 0.2s ease; }
.sbs:hover .sbs-val { transform: scale(1.1); }

.completion-bars { display: flex; flex-direction: column; gap: 10px; }
.cbar { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; padding: 4px 8px; margin: -4px -8px; border-radius: 6px; transition: all 0.2s ease; cursor: default; }
.cbar:hover { background: var(--bg-hover); }
.cbar span:first-child { width: 80px; color: var(--text-secondary); transition: color 0.2s ease; }
.cbar:hover span:first-child { color: var(--text-primary); }
.cbar-track { flex: 1; height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; transition: height 0.2s ease; }
.cbar:hover .cbar-track { height: 12px; }
.cbar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: all 0.4s ease; }
.cbar:hover .cbar-fill { filter: brightness(1.15); }
.cbar span:last-child { width: 40px; font-weight: 700; color: var(--text-primary); text-align: right; transition: transform 0.2s ease; }
.cbar:hover span:last-child { transform: scale(1.1); }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: flex; align-items: center; gap: 10px; padding: 4px 8px; margin: -4px -8px; border-radius: 8px; transition: all 0.2s ease; cursor: default; }
.hb:hover { background: var(--bg-hover); transform: translateX(4px); }
.hb-l { width: 60px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s ease; }
.hb:hover .hb-l { color: var(--text-primary); }
.hb-t { flex: 1; height: 16px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; transition: all 0.2s ease; }
.hb:hover .hb-t { height: 20px; }
.hb-f { height: 100%; border-radius: 4px; transition: all 0.4s ease; }
.hb:hover .hb-f { filter: brightness(1.15); }
.hb-v { width: 40px; font-size: 0.8rem; font-weight: 700; color: var(--text-primary); text-align: right; transition: transform 0.2s ease; }
.hb:hover .hb-v { transform: scale(1.1); }

.year-range { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.year-range::before { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.year-range::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--border)); }

/* Year Timeline - Redesigned (Large) */
.year-timeline { position: relative; padding: 16px 0 12px; }
.year-timeline-bars { display: flex; align-items: flex-end; justify-content: center; height: 200px; gap: 4px; position: relative; padding-bottom: 22px; }
.year-timeline-bars::before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent 5%, var(--border) 20%, var(--border) 80%, transparent 95%); }
/* Grid lines */
.year-timeline-bars::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to top, transparent, transparent 49px, rgba(255,255,255,0.03) 49px, rgba(255,255,255,0.03) 50px); pointer-events: none; }
.ytl-bar { flex: 1 1 0; min-width: 8px; max-width: 80px; height: 100%; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.ytl-bar:only-child { max-width: 60px; }
.ytl-track { flex: 1; width: 100%; display: flex; align-items: flex-end; overflow: hidden; }
.ytl-fill { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; transition: height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.2s ease, filter 0.2s ease; }
.ytl-fill.animate-fill { height: 0 !important; }
.ytl-fill { transform-origin: bottom; }
.ytl-bar:hover .ytl-fill { transform: scaleY(1.08); filter: brightness(1.15); }
.ytl-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 0.65rem; color: #9ca3af; transition: all 0.2s ease; white-space: nowrap; }
.ytl-bar:hover .ytl-label { color: var(--primary); font-weight: 600; }
.ytl-bar.decade .ytl-label { color: var(--text-secondary); font-weight: 600; }

/* Year Timeline - Value above bar (unified with vbar style) */
.ytl-bar .vbar-value {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

/* Year Timeline Tooltip (using vbar-tooltip for consistency) */
.ytl-bar .vbar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    z-index: 9999;
    pointer-events: none;
}

/* Legacy tooltip styles (kept for backwards compatibility) */
.ytl-tooltip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(6px); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; opacity: 0; visibility: hidden; transition: all 0.2s ease; pointer-events: none; z-index: 10; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.3); text-align: center; }
.ytl-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--border); }
.ytl-bar:hover .ytl-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.ytl-tooltip-year { font-weight: 700; color: var(--primary); font-size: 1rem; }
.ytl-tooltip-count { color: var(--text-secondary); font-size: 0.8rem; margin-top: 2px; }
.ytl-tooltip-count strong { color: var(--text-primary); font-weight: 600; }

/* Year Timeline Highlighted States */
.ytl-bar.highlighted .ytl-fill { transform: scaleY(1.1); filter: brightness(1.25); }
.ytl-bar.highlighted .ytl-label { color: var(--primary); font-weight: 700; }
.ytl-bar.dimmed { opacity: 0.25; }
.ytl-bar.dimmed .ytl-fill { filter: brightness(0.6) saturate(0.5); }

.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rk { display: flex; align-items: center; gap: 10px; padding: 4px 8px; margin: -4px -8px; border-radius: 8px; transition: all 0.2s ease; cursor: default; }
.rk:hover { background: var(--bg-hover); transform: translateX(4px); }
.rk-p { width: 20px; font-size: 0.8rem; font-weight: 800; color: #9ca3af; transition: transform 0.2s ease; }
.rk:hover .rk-p { transform: scale(1.2); }
.rk-p.top1 { color: #fbbf24; }
.rk-p.top2 { color: #94a3b8; }
.rk-p.top3 { color: #d97706; }
.rk-n { width: 90px; font-size: 0.8rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s ease; }
.rk:hover .rk-n { color: var(--primary); }
.rk-b { flex: 1; height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; transition: height 0.2s ease; }
.rk:hover .rk-b { height: 12px; }
.rk-f { height: 100%; background: var(--primary); border-radius: 4px; transition: filter 0.2s ease; }
.rk:hover .rk-f { filter: brightness(1.15); }
.rk-v { width: 24px; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-align: right; transition: all 0.2s ease; }
.rk:hover .rk-v { color: var(--text-primary); transform: scale(1.1); }

/* === INTERACTIVE CHART HIGHLIGHT STATES === */
.dleg.highlighted { background: var(--primary-subtle); transform: translateX(6px); }
.dleg.highlighted .dleg-dot { transform: scale(1.4); box-shadow: 0 0 8px currentColor; }
.dleg.highlighted .dleg-name { color: var(--text-primary); font-weight: 600; }
.dleg.dimmed { opacity: 0.35; transform: translateX(0); }

.sbar.highlighted { background: var(--primary-subtle); }
.sbar.highlighted .sbar-l { color: var(--primary); font-weight: 800; transform: scale(1.1); }
.sbar.highlighted .sbar-t { height: 20px; }
.sbar.highlighted .sbar-f { filter: brightness(1.25) saturate(1.2); }
.sbar.highlighted .sbar-v { color: var(--primary); transform: scale(1.15); }
.sbar.dimmed { opacity: 0.35; }

.hb.highlighted { background: var(--primary-subtle); transform: translateX(8px); }
.hb.highlighted .hb-l { color: var(--text-primary); }
.hb.highlighted .hb-t { height: 22px; }
.hb.highlighted .hb-f { filter: brightness(1.3) saturate(1.2); }
.hb.highlighted .hb-v { transform: scale(1.15); color: var(--primary); }
.hb.dimmed { opacity: 0.35; transform: translateX(0); }

.rk.highlighted { background: var(--primary-subtle); transform: translateX(8px); }
.rk.highlighted .rk-p { transform: scale(1.3); color: var(--primary) !important; }
.rk.highlighted .rk-n { color: var(--primary); font-weight: 600; }
.rk.highlighted .rk-b { height: 14px; }
.rk.highlighted .rk-f { filter: brightness(1.3); }
.rk.highlighted .rk-v { color: var(--primary); transform: scale(1.15); }
.rk.dimmed { opacity: 0.35; transform: translateX(0); }

.tags-header { font-size: 0.8rem; color: #9ca3af; margin-bottom: 12px; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.ctag { padding: 5px 12px; background: var(--bg-hover); border-radius: 14px; color: var(--text-secondary); transition: all 0.2s; }
.ctag:hover { background: var(--primary-subtle); color: var(--primary); }

.time-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 14px; text-align: center; transition: all 0.25s ease; cursor: default; }
.time-box:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.15); border-color: var(--primary); background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, var(--bg-surface) 100%); }
.time-box:hover .time-value { transform: scale(1.1); }
.time-value { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: 4px; transition: transform 0.25s ease; }
.time-label { font-size: 0.7rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.03em; transition: color 0.25s ease; }
.time-box:hover .time-label { color: var(--text-secondary); }

/* ===== NEW VIEWING PATTERNS CHARTS ===== */

/* Episode Length Distribution */
.episode-dist { display: flex; flex-direction: column; gap: 10px; }
.ep-dist-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: -6px -10px; border-radius: 10px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); cursor: default; }
.ep-dist-bar:hover { background: var(--bg-hover); transform: translateX(4px); }
.ep-dist-label { width: 120px; font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; transition: color 0.2s ease; }
.ep-dist-bar:hover .ep-dist-label { color: var(--text-primary); }
.ep-dist-track { flex: 1; height: 14px; background: var(--bg-hover); border-radius: 7px; overflow: hidden; transition: height 0.2s ease; }
.ep-dist-bar:hover .ep-dist-track { height: 18px; }
.ep-dist-fill { height: 100%; border-radius: 7px; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.ep-dist-bar:hover .ep-dist-fill { filter: brightness(1.2); transform: scaleX(1.02); }
.ep-dist-value { width: 70px; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-align: right; transition: all 0.2s ease; }
.ep-dist-bar:hover .ep-dist-value { color: var(--text-primary); }
.ep-dist-pct { font-weight: 400; color: #9ca3af; }
.ep-dist-bar.highlighted { background: var(--primary-subtle); transform: translateX(8px); }
.ep-dist-bar.highlighted .ep-dist-label { color: var(--primary); font-weight: 600; }
.ep-dist-bar.highlighted .ep-dist-track { height: 20px; }
.ep-dist-bar.highlighted .ep-dist-fill { filter: brightness(1.35); }
.ep-dist-bar.highlighted .ep-dist-value { color: var(--primary); transform: scale(1.1); }
.ep-dist-bar.dimmed { opacity: 0.3; transform: translateX(0); }

/* Season Preference Chart */
.season-chart { display: flex; align-items: center; gap: 20px; padding: 10px 0; }
.season-chart canvas { flex-shrink: 0; cursor: default; }
.season-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sleg { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: -6px -10px; border-radius: 8px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.sleg:hover { background: var(--bg-hover); transform: translateX(4px); }
.sleg-dot { width: 12px; height: 12px; border-radius: 50%; transition: all 0.25s ease; }
.sleg:hover .sleg-dot { transform: scale(1.3); box-shadow: 0 0 10px currentColor; }
.sleg-name { font-size: 0.8rem; color: var(--text-secondary); flex: 1; transition: color 0.2s ease; }
.sleg:hover .sleg-name { color: var(--text-primary); }
.sleg-val { font-size: 0.75rem; font-weight: 700; color: #9ca3af; transition: all 0.2s ease; white-space: nowrap; text-align: right; }
.sleg:hover .sleg-val { color: var(--primary); }
.sleg.highlighted { background: var(--primary-subtle); transform: translateX(8px); }
.sleg.highlighted .sleg-dot { transform: scale(1.5); box-shadow: 0 0 12px currentColor; }
.sleg.highlighted .sleg-name { color: var(--primary); font-weight: 600; }
.sleg.highlighted .sleg-val { color: var(--primary); transform: scale(1.15); }
.sleg.dimmed { opacity: 0.3; transform: translateX(0); }

/* Source Material Chart */
.source-chart { display: flex; flex-direction: column; gap: 8px; }
.source-bar { display: flex; align-items: center; gap: 10px; padding: 5px 10px; margin: -5px -10px; border-radius: 8px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); cursor: default; }
.source-bar:hover { background: var(--bg-hover); transform: translateX(4px); }
.source-label { width: 85px; font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s ease; }
.source-bar:hover .source-label { color: var(--text-primary); }
.source-track { flex: 1; height: 12px; background: var(--bg-hover); border-radius: 6px; overflow: hidden; transition: height 0.2s ease; }
.source-bar:hover .source-track { height: 16px; }
.source-fill { height: 100%; border-radius: 6px; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.source-bar:hover .source-fill { filter: brightness(1.2); }
.source-value { width: 30px; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-align: right; transition: all 0.2s ease; }
.source-bar:hover .source-value { color: var(--text-primary); }
.source-bar.highlighted { background: var(--primary-subtle); transform: translateX(8px); }
.source-bar.highlighted .source-label { color: var(--primary); font-weight: 600; }
.source-bar.highlighted .source-track { height: 18px; }
.source-bar.highlighted .source-fill { filter: brightness(1.35); }
.source-bar.highlighted .source-value { color: var(--primary); transform: scale(1.15); }
.source-bar.dimmed { opacity: 0.3; transform: translateX(0); }

/* Monthly Activity Chart */
.monthly-chart-header { font-size: 0.85rem; color: #9ca3af; margin-bottom: 16px; text-align: center; }
.monthly-chart { padding: 10px 0; }
.monthly-bars { display: flex; align-items: flex-end; justify-content: center; height: 150px; gap: 6px; position: relative; }
.monthly-bars::before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent 5%, var(--border) 20%, var(--border) 80%, transparent 95%); }
.monthly-bar { flex: 1 1 0; min-width: 20px; max-width: 80px; height: 100%; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.monthly-bar:only-child { max-width: 60px; }
.monthly-fill { flex: none; width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; transition: all 0.25s ease; }
.monthly-bar:hover .monthly-fill { transform: scaleY(1.08); filter: brightness(1.15); }
.monthly-label { font-size: 0.65rem; color: #9ca3af; margin-top: 8px; transition: all 0.2s ease; }
.monthly-bar:hover .monthly-label { color: var(--primary); font-weight: 600; }
.monthly-tooltip { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(8px); padding: 10px 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; font-size: 0.8rem; color: var(--text-primary); text-align: center; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.2s ease; pointer-events: none; z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.monthly-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--border); }
.monthly-bar:hover .monthly-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.monthly-bar.highlighted .monthly-fill { transform: scaleY(1.1); filter: brightness(1.2); }
.monthly-bar.highlighted .monthly-label { color: var(--primary); font-weight: 700; }
.monthly-bar.dimmed { opacity: 0.25; }
.monthly-bar.dimmed .monthly-fill { filter: brightness(0.6) saturate(0.5); }

/* ===== MODAL ===== */
.modal-overlay:not(#addListModal):not(#editListModal) { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.2s; z-index: 1100; }
.modal-overlay.open:not(#addListModal):not(#editListModal) { opacity: 1; visibility: visible; pointer-events: auto; backdrop-filter: blur(8px); }
.modal:not(.add-list-modal):not(.shared-modal) { width: 100%; max-width: 440px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 18px; transform: scale(0.9); transition: transform 0.25s ease; }
.modal-overlay.open .modal:not(.add-list-modal):not(.shared-modal) { transform: scale(1); }
.modal-header:not(.shared-modal .modal-header) { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-header:not(.shared-modal .modal-header) h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.modal-close:not(.shared-modal .modal-close) { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: #9ca3af; cursor: pointer; border-radius: 8px; }
.modal-close:not(.shared-modal .modal-close):hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-close:not(.shared-modal .modal-close) svg { width: 18px; height: 18px; }
.modal-body:not(.shared-modal .modal-body) { padding: 22px; }
.modal-anime-info { display: flex; gap: 14px; margin-bottom: 22px; }
.modal-anime-info img { width: 65px; height: 92px; object-fit: cover; border-radius: 10px; }
.modal-anime-info h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.modal-anime-info p { font-size: 0.8rem; color: #9ca3af; }
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.form-group select, .form-group textarea, .form-group input[type="text"] { width: 100%; padding: 10px 12px; font-size: 0.9rem; color: var(--text-primary); background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; }
.form-group select:focus, .form-group textarea:focus, .form-group input[type="text"]:focus { outline: none; border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 70px; }
.progress-input { display: flex; align-items: center; gap: 8px; }
.progress-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.progress-btn:hover { background: var(--primary); border-color: var(--primary); color: white; }
.progress-input input[type="number"] { width: 65px; padding: 8px 10px; font-size: 1rem; font-weight: 600; text-align: center; color: var(--text-primary); background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px; }
.progress-input input:focus { outline: none; border-color: var(--primary); }
.progress-max { font-size: 0.85rem; color: #9ca3af; }
.score-input { display: flex; align-items: center; gap: 12px; }
.score-input input[type="range"] { flex: 1; height: 6px; background: var(--border); border-radius: 3px; -webkit-appearance: none; cursor: pointer; }
.score-input input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer; }
.score-display { font-size: 1.15rem; font-weight: 800; color: var(--primary); min-width: 28px; text-align: center; }
.modal-footer:not(.shared-modal .modal-footer) { display: flex; justify-content: space-between; padding: 16px 22px; border-top: 1px solid var(--border); }
.btn-delete { display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 0.8rem; font-weight: 600; color: var(--error); background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); border-radius: 10px; cursor: pointer; }
.btn-delete svg { width: 15px; height: 15px; }
.btn-delete:hover { background: rgba(239,68,68,0.2); }
.btn-save { padding: 10px 22px; font-size: 0.85rem; font-weight: 600; color: white; background: var(--primary); border: none; border-radius: 10px; cursor: pointer; }
.btn-save:hover { background: var(--primary-hover); }

/* Rewatch input - same style as progress */
.rewatch-input { display: flex; align-items: center; gap: 8px; }
.rewatch-input input[type="number"] { width: 65px; padding: 8px 10px; font-size: 1rem; font-weight: 600; text-align: center; color: var(--text-primary); background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px; }
.rewatch-input input:focus { outline: none; border-color: var(--primary); }

/* Rewatch badge in list view */
.rewatch-badge { font-size: 0.7rem; padding: 2px 6px; background: var(--primary-subtle); color: var(--primary); border-radius: 4px; font-weight: 600; }

/* Hidden entries (private anime) */
.hidden-entry { opacity: 0.6; }
.hidden-entry:hover { opacity: 0.85; }

.hidden-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    z-index: 10;
}
.hidden-badge svg {
    width: 20px;
    height: 20px;
    color: #ef4444;
}


/* Hidden badge in list view item cover */
.item-cover { position: relative; }
.item-cover .hidden-badge {
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
}
.item-cover .hidden-badge svg {
    width: 18px;
    height: 18px;
}

/* Hidden badge in series entry cards */
.entry-hidden-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #ef4444;
}
.entry-hidden-badge svg {
    width: 16px;
    height: 16px;
}

/* ===== IMPORT MODAL ===== */
.import-modal { max-width: 520px; }
.import-tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--bg-deep); border-radius: 10px; }
.import-tab { flex: 1; padding: 10px 16px; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); background: none; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.import-tab:hover { color: var(--text-primary); }
.import-tab.active { background: var(--primary); color: white; }
.import-source { display: none; }
.import-source.active { display: block; }
.import-info { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.import-info a { color: var(--primary); text-decoration: underline; }
.file-drop-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 32px 20px; text-align: center; cursor: pointer; transition: all 0.2s; }
.file-drop-zone:hover, .file-drop-zone.dragover { border-color: var(--primary); background: var(--primary-subtle); }
.file-drop-zone svg { width: 40px; height: 40px; color: #9ca3af; margin-bottom: 12px; }
.file-drop-zone span { display: block; font-size: 0.85rem; color: var(--text-secondary); }
.file-label { color: var(--primary); cursor: pointer; text-decoration: underline; }
.file-selected { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 14px; background: var(--bg-deep); border-radius: 8px; font-size: 0.85rem; color: var(--text-primary); }
.file-selected:empty { display: none; }
.file-selected svg { width: 18px; height: 18px; color: var(--primary); }
.import-options { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.import-status { margin-top: 16px; }
.status-loading { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg-deep); border-radius: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.status-loading .spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-success { padding: 12px 16px; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); border-radius: 8px; font-size: 0.85rem; color: #4ade80; }
.status-error { padding: 12px 16px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 8px; font-size: 0.85rem; color: #f87171; }
.status-not-found { margin-top: 8px; padding: 10px 16px; background: var(--bg-deep); border-radius: 8px; font-size: 0.8rem; color: var(--text-secondary); }
.status-not-found summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.status-not-found ul { margin: 8px 0 0; padding-left: 18px; max-height: 160px; overflow-y: auto; }
.status-not-found li { margin-bottom: 3px; }
.btn-cancel { padding: 10px 20px; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.btn-cancel:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* ===== SOCIAL TAB ===== */
.social-tabs { display: flex; gap: 12px; margin-bottom: 20px; }
.social-tab { display: flex; align-items: center; gap: 10px; flex: 1; padding: 14px 18px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.social-tab:hover { border-color: var(--primary); color: var(--text-primary); }
.social-tab.active { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary); }
.social-tab svg { width: 18px; height: 18px; }
.social-count { margin-left: auto; padding: 3px 10px; background: var(--bg-deep); border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.social-tab.active .social-count { background: var(--primary); color: white; }
.social-content { display: none; animation: fadeIn 0.3s ease; }
.social-content.active { display: block; }

/* Social Loading State */
.social-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.social-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.social-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; }
.social-empty svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 12px; opacity: 0.5; }
.social-empty p { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 16px; }
.btn-browse { padding: 10px 20px; background: var(--primary); color: white; border-radius: 8px; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.btn-browse:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* Reviews Section */
.reviews-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.reviews-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
}

.reviews-section-header h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.reviews-grid {
    display: flex;
    flex-direction: column;
}

.user-review-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.user-review-card:last-child { border-bottom: none; }
.user-review-card:hover { background: var(--bg-hover); }
.user-review-card.hidden-content { opacity: 0.5; }

.review-anime-link { flex-shrink: 0; }
.review-anime-link img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.review-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-anime-title {
    display: inline;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.review-anime-title:hover { color: var(--primary); }

.review-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 2px;
}

.review-likes { display: flex; align-items: center; gap: 4px; }
.review-likes svg { width: 12px; height: 12px; }

.badge-spoiler, .badge-hidden, .badge-pinned, .badge-locked {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-spoiler { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-hidden { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-pinned { background: var(--primary-subtle); color: var(--primary); }
.badge-locked { background: rgba(239, 68, 68, 0.12); color: #f87171; }

/* Forum Activity - Compact List Style */
.forum-activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.forum-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.forum-section h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    padding: 14px 18px;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
}

.user-threads-list, .user-posts-list {
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
}

.user-threads-list::-webkit-scrollbar,
.user-posts-list::-webkit-scrollbar {
    width: 6px;
}

.user-threads-list::-webkit-scrollbar-track,
.user-posts-list::-webkit-scrollbar-track {
    background: transparent;
}

.user-threads-list::-webkit-scrollbar-thumb,
.user-posts-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.user-threads-list::-webkit-scrollbar-thumb:hover,
.user-posts-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.user-thread-item, .user-post-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.user-thread-item:last-child, .user-post-item:last-child { border-bottom: none; }
.user-thread-item:hover, .user-post-item:hover { background: var(--bg-hover); }
.user-thread-item.hidden-content, .user-post-item.hidden-content { opacity: 0.5; }

.thread-item-link, .post-item-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.thread-item-main {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.thread-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-item-link:hover .thread-item-title,
.post-item-link:hover .post-item-thread { color: var(--primary); }

.thread-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #6b7280;
}

.thread-category {
    padding: 2px 6px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.65rem;
}

.thread-stats { color: #6b7280; }

.post-item-thread {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.post-item-content {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #6b7280;
}

/* Edited Badge */
.edited-badge { color: #6b7280; font-style: italic; font-size: 0.9em; }

/* Action Buttons - Inline on hover */
.review-card-actions, .item-actions-row {
    display: flex;
    flex-direction: row;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.user-review-card:hover .review-card-actions,
.user-thread-item:hover .item-actions-row,
.user-post-item:hover .item-actions-row { opacity: 1; }

.btn-action-small {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-action-small:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

.btn-action-small svg { width: 14px; height: 14px; }
.btn-action-small.btn-action-danger:hover {
    border-color: #f87171;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* Tier Lists Section */
.tierlists-section {
    margin-top: 20px;
}

.tierlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.tierlist-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    overflow: hidden;
}

.tierlist-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Mini tier preview */
.mini-tierlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 100px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: 4px;
    overflow: hidden;
    filter: blur(0.5px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s, filter 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.tierlist-card:hover .mini-tierlist {
    opacity: 0.7;
    filter: blur(0.2px);
}

.mini-tier-row {
    display: flex;
    min-height: 12px;
}

.mini-tier-label {
    width: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.35rem;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
}

.mini-tier-items {
    flex: 1;
    display: flex;
    gap: 1px;
    padding: 1px;
    background: rgba(0, 0, 0, 0.25);
    min-height: 12px;
}

.mini-tier-items img {
    width: 14px;
    height: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.tierlist-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tierlist-card-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tierlist-card:hover .tierlist-card-title {
    color: var(--primary);
}

.badge-private {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.tierlist-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tierlist-type {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 600;
    text-transform: capitalize;
}

.tierlist-type svg {
    width: 12px;
    height: 12px;
}

.tierlist-items {
    color: var(--text-secondary);
}

.tierlist-stats {
    display: flex;
    align-items: center;
    gap: 3px;
}

.tierlist-stats svg {
    width: 12px;
    height: 12px;
}

.tierlist-score {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tierlist-score svg {
    width: 12px;
    height: 12px;
}

.tierlist-score.positive {
    color: #4ade80;
}

.tierlist-score.negative {
    color: #f87171;
}

.tierlist-score.negative svg {
    transform: rotate(180deg);
}

.tierlist-card-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Social Stats Grid */
.stats-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-box.accent-purple { background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15) 0%, rgba(var(--primary-rgb), 0.05) 100%); border-color: rgba(var(--primary-rgb), 0.3); }
.stat-box.accent-purple .stat-box-value { color: var(--primary-light); }
.stat-box.accent-pink { background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(236, 72, 153, 0.05) 100%); border-color: rgba(236, 72, 153, 0.3); }
.stat-box.accent-pink .stat-box-value { color: #f472b6; }
.stat-box.accent-blue { background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%); border-color: rgba(59, 130, 246, 0.3); }
.stat-box.accent-blue .stat-box-value { color: #60a5fa; }
.stat-box.accent-teal { background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(20, 184, 166, 0.05) 100%); border-color: rgba(20, 184, 166, 0.3); }
.stat-box.accent-teal .stat-box-value { color: #2dd4bf; }
.stat-box.accent-green { background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%); border-color: rgba(34, 197, 94, 0.3); }
.stat-box.accent-green .stat-box-value { color: #4ade80; }
.stat-box.accent-red { background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%); border-color: rgba(239, 68, 68, 0.3); }
.stat-box.accent-red .stat-box-value { color: #f87171; }
.stat-box.accent-orange { background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.05) 100%); border-color: rgba(249, 115, 22, 0.3); }
.stat-box.accent-orange .stat-box-value { color: #fb923c; }

/* Accent hover effects for stat boxes */
.stat-box.accent-purple:hover { border-color: rgba(var(--primary-rgb), 0.6); box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.2); }
.stat-box.accent-pink:hover { border-color: rgba(236, 72, 153, 0.6); box-shadow: 0 8px 24px rgba(236, 72, 153, 0.2); }
.stat-box.accent-blue:hover { border-color: rgba(59, 130, 246, 0.6); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2); }
.stat-box.accent-teal:hover { border-color: rgba(20, 184, 166, 0.6); box-shadow: 0 8px 24px rgba(20, 184, 166, 0.2); }
.stat-box.accent-green:hover { border-color: rgba(34, 197, 94, 0.6); box-shadow: 0 8px 24px rgba(34, 197, 94, 0.2); }
.stat-box.accent-red:hover { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2); }
.stat-box.accent-orange:hover { border-color: rgba(249, 115, 22, 0.6); box-shadow: 0 8px 24px rgba(249, 115, 22, 0.2); }

/* Series Statistics Styles */
.series-progress-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.series-progress-numbers {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.series-progress-numbers span:first-child {
    color: var(--primary);
    font-weight: 600;
}

.series-progress-pct {
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: right;
}

.series-stat-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: #9ca3af;
}

.series-stat-detail strong {
    color: var(--text-secondary);
}

.cbar-fill.accent-purple {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.cbar-fill.accent-teal {
    background: linear-gradient(90deg, #14b8a6 0%, #2dd4bf 100%);
}

/* Series Ranking List */
.series-rank-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.series-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-deep);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.series-rank-item:hover {
    background: var(--bg-card);
    transform: translateX(3px);
}

.series-rank-position {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.series-rank-position.gold { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.series-rank-position.silver { background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%); }
.series-rank-position.bronze { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }

.series-rank-cover {
    width: 32px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.series-rank-info {
    flex: 1;
    min-width: 0;
}

.series-rank-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.series-rank-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.series-rank-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.series-rank-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
}

.series-rank-label {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
}

/* Empty message */
.empty-msg { padding: 24px; text-align: center; color: #9ca3af; font-size: 0.9rem; }

/* Confirmation Modal */
.confirm-modal { max-width: 420px; }
.confirm-modal .modal-body { padding: 24px 22px; text-align: center; }
.confirm-message { color: var(--text-secondary); line-height: 1.6; margin: 0; font-size: 0.95rem; }
.confirm-modal .modal-footer { justify-content: center; gap: 12px; }
.confirm-modal .btn-cancel { min-width: 100px; }
.confirm-modal .btn-delete { min-width: 100px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .charts-row { grid-template-columns: 1fr; }
    .secondary-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1000px) {
    .stats-grid-6 { grid-template-columns: repeat(3, 1fr); }
    .stats-grid-5 { grid-template-columns: repeat(5, 1fr); }
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-3 { grid-template-columns: 1fr; }
    .stats-grid-2 { grid-template-columns: 1fr; }
    .primary-stats { grid-template-columns: repeat(2, 1fr); }
    .donuts-row { grid-template-columns: 1fr; }
    .patterns-row { grid-template-columns: 1fr; }
    .time-row { grid-template-columns: repeat(5, 1fr); }
    .social-row { grid-template-columns: repeat(5, 1fr); }
    .series-overview-row { grid-template-columns: repeat(3, 1fr); }
    .series-details-row { grid-template-columns: 1fr; }
    .series-progress-panel { padding: 16px; }
    .progress-ring-wrap { width: 70px; height: 70px; }
    .progress-ring-value { font-size: 1rem; }
    .overview-top-three { grid-template-columns: 1fr 1fr; }
    .recent-activity-panel { grid-column: span 2; }
}
@media (max-width: 1100px) {
    .overview-top-three { grid-template-columns: 1fr 1fr; }
    .overview-top-three .recent-activity-panel { grid-column: span 2; }

    /* Adjust panel heights for 2-column layout */
    .overview-top-three > .panel,
    .overview-top-three #favoritesPanel {
        height: 400px;
        min-height: 400px;
        max-height: 400px;
    }

    /* Recent activity can be shorter since it spans full width */
    .overview-top-three .recent-activity-panel {
        height: 280px;
        min-height: 280px;
        max-height: 280px;
    }
}
@media (max-width: 900px) {
    .overview-grid { grid-template-columns: 1fr; }
    .overview-right { order: -1; }
    .overview-top-row { grid-template-columns: 1fr; }
    .overview-top-row > .panel:only-child { grid-column: span 1; }
    .hero-stats-row { grid-template-columns: repeat(2, 1fr); }
    .favorites-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; }
}
@media (max-width: 768px) {
    /* User banner adjustments for floating nav (no top navbar) */
    .user-banner {
        margin-top: 0;
        padding-top: 0;
        height: 200px; /* Shorter banner for mobile */
    }

    /* Avatar smaller and centered */
    .profile-avatar-wrap {
        margin-top: -50px;
    }

    .user-avatar {
        width: 100px;
        height: 100px;
    }

    .user-avatar svg {
        width: 35px;
        height: 35px;
    }

    /* Profile info stacked vertically, centered */
    .profile-info-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        height: auto;
        padding: 12px;
        gap: 12px;
    }

    .profile-info-main {
        width: 100%;
        text-align: center;
    }

    .profile-info-main h1 {
        font-size: 1.3rem;
        text-align: center;
        white-space: normal;
    }

    /* Social stats centered */
    .profile-social-stats {
        margin-left: 0;
        justify-content: center;
    }

    /* Tab navigation horizontally scrollable */
    .profile-tabs-inline {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        padding: 0 12px;
        gap: 6px;
    }

    .profile-tabs-inline::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }

    .profile-tabs-inline .profile-tab {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.85rem;
        min-height: 44px; /* Touch target */
        display: flex;
        align-items: center;
    }

    /* Stats row - 2 columns */
    .overview-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .overview-stat {
        padding: 14px 10px;
        min-height: 80px; /* Ensure adequate touch target */
    }

    .overview-stat-value {
        font-size: 1.4rem;
    }

    /* Favorites grid - 4-5 columns or horizontal scroll */
    .favorites-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Activity heatmap - horizontally scrollable */
    .activity-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .activity-graph {
        min-width: 600px;
        gap: 2px;
    }

    /* Main content padding */
    .profile-main {
        padding: 16px 12px 100px; /* 100px bottom for floating nav */
    }
}
@media (max-width: 700px) {
    /* Further banner reduction */
    .user-banner { height: 180px; }

    /* Stats grids responsive */
    .stats-grid-6 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .secondary-stats { grid-template-columns: repeat(2, 1fr); }
    .series-overview-row { grid-template-columns: repeat(2, 1fr); }
    .time-row { grid-template-columns: repeat(3, 1fr); }
    .social-row { grid-template-columns: repeat(3, 1fr); }

    /* List controls stacked */
    .list-controls-bar { flex-direction: column; align-items: stretch; gap: 12px; }
    .list-actions { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
    .status-filter-row { flex-direction: column; gap: 12px; }
    .list-search { width: 100%; }

    /* Overview layout single column */
    .overview-top-three { grid-template-columns: 1fr; }
    .recent-activity-panel { grid-column: span 1; }
    .overview-bottom-row { grid-template-columns: 1fr; }

    /* Remove fixed heights on mobile - auto height */
    .overview-top-three > .panel,
    .overview-top-three #favoritesPanel,
    .overview-top-three .recent-activity-panel {
        height: auto;
        min-height: auto;
        max-height: none;
    }

    /* Favorites shows 2 rows max on mobile with scroll */
    .overview-top-three #favoritesPanel {
        max-height: 320px;
    }

    /* Favorites grid 5 columns on mobile */
    .overview-top-three #favoritesPanel .favorites-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Touch targets for all buttons */
    .social-stat-btn {
        padding: 8px 12px;
        min-height: 44px;
        min-width: 44px;
    }

    .social-stat-btn .stat-count { font-size: 1rem; }
    .social-stat-btn .stat-label { font-size: 0.65rem; }
}
@media (max-width: 600px) {
    .activity-panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .activity-graph { min-width: 350px; gap: 2px; }
    .activity-day { min-width: 12px; min-height: 12px; }
}

@media (max-width: 550px) {
    /* Favorites grid 4 columns */
    .favorites-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }

    /* Overview favorites also 4 columns on small screens */
    .overview-top-three #favoritesPanel .favorites-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Compact list items with smaller covers */
    .list-item {
        grid-template-columns: 60px 1fr;
        gap: 10px;
        position: relative;
        padding: 12px;
        min-height: 100px;
    }

    .item-cover {
        width: 60px;
        height: 84px;
    }

    .item-actions {
        position: absolute;
        top: 10px;
        right: 10px;
        min-height: 44px; /* Touch target */
    }

    .item-actions button {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    /* Stats grids */
    .stats-grid-5 { grid-template-columns: 1fr 1fr; }
    .primary-stats { grid-template-columns: 1fr 1fr; }
    .secondary-stats { grid-template-columns: 1fr 1fr; }
    .series-overview-row { grid-template-columns: 1fr 1fr; }
    .time-row { grid-template-columns: repeat(2, 1fr); }
    .time-row .time-box:last-child { grid-column: span 2; }
    .social-row { grid-template-columns: repeat(2, 1fr); }
    .social-row .stat-box:last-child { grid-column: span 2; }

    /* Social tabs stacked */
    .social-tabs { flex-direction: column; }
    .forum-activity { grid-template-columns: 1fr; }
    .user-threads-list, .user-posts-list { max-height: 300px; }
    .tierlists-grid { grid-template-columns: 1fr; }

    /* Show actions on touch devices */
    .review-card-actions, .item-actions-row { opacity: 1; }

    /* Ensure all clickable elements meet touch target size */
    button:not(.modal-close-float):not(.btn-remove-icon), a.btn, .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    /* Very compact stats */
    .overview-stats-row { gap: 8px; }
    .overview-stat {
        padding: 12px 8px;
        border-radius: 8px;
        min-height: 70px;
    }
    .overview-stat-value { font-size: 1.2rem; }
    .overview-stat-label { font-size: 0.65rem; }

    /* Activity heatmap - smaller */
    .activity-graph { min-width: 320px; }
    .activity-day { min-width: 10px; min-height: 10px; border-radius: 1px; }

    /* Banner even shorter */
    .user-banner { height: 160px; }

    /* Profile padding tighter */
    .profile-main { padding: 12px 10px 100px; }

    /* Tabs even more compact */
    .profile-tabs-inline .profile-tab {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    /* Smallest screens - 3 column favorites */
    .favorites-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }

    /* Overview favorites also 3 columns */
    .overview-top-three #favoritesPanel .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    /* Smaller max height for favorites on tiny screens */
    .overview-top-three #favoritesPanel {
        max-height: 280px;
    }

    /* Ultra compact banner */
    .user-banner { height: 140px; }

    /* Tighter spacing */
    .profile-main { padding: 10px 8px 100px; }

    /* Smaller avatar */
    .user-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-avatar-wrap {
        margin-top: -40px;
    }
}

/* ===== MOBILE-SPECIFIC ENHANCEMENTS ===== */
@media (max-width: 768px) {
    /* Smooth scrolling for horizontal scrollable elements */
    .profile-tabs-inline,
    .favorites-grid,
    .activity-panel,
    .activity-graph {
        scroll-behavior: smooth;
    }

    /* Hide scrollbars but keep scrolling */
    .profile-tabs-inline::-webkit-scrollbar,
    .favorites-grid::-webkit-scrollbar,
    .activity-panel::-webkit-scrollbar {
        display: none;
    }

    .profile-tabs-inline,
    .favorites-grid,
    .activity-panel {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    /* Panel responsive padding */
    .panel {
        padding: 14px 12px;
        border-radius: 10px;
    }

    .panel-header {
        margin-bottom: 12px;
    }

    .panel-title {
        font-size: 0.8rem;
    }

    /* Profile actions touch-friendly */
    .profile-actions button,
    .follow-actions button {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px;
    }

    .btn-signout {
        min-width: 44px;
        min-height: 44px;
    }

    /* Favorite cards touch area */
    .favorite-card {
        border-radius: 4px;
    }

    /* Status grid single column on mobile */
    .status-grid {
        grid-template-columns: 1fr;
    }

    .status-item {
        min-height: 44px;
        padding: 12px;
    }

    /* Touch-friendly list type switcher */
    .list-type-btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* Activity tooltip mobile positioning */
    .activity-tooltip {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    /* Compact genre tags */
    .genre-tag, .tag {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Remove hover effects on touch devices */
    .overview-stat:hover {
        transform: none;
    }

    .panel:hover {
        border-color: var(--border);
    }

    /* List item info compact */
    .item-info {
        gap: 4px;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .item-meta {
        font-size: 0.75rem;
    }

    /* Progress bars mobile */
    .progress-bar-wrap {
        height: 6px;
    }

    /* Responsive charts */
    .chart-container {
        padding: 12px;
    }

    /* Modal padding */
    .modal-content {
        padding: 16px;
        margin: 20px;
    }

    /* Form elements touch-friendly */
    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ===== NOTIFICATIONS TAB ===== */
.notifications-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 8px 0;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.notifications-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notifications-header h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.notifications-header .unread-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    font-family: var(--font-body);
    min-width: 18px;
    text-align: center;
}

.notifications-actions {
    display: flex;
    gap: 4px;
}

.notif-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.notif-btn svg {
    width: 16px;
    height: 16px;
}

.notif-btn:hover {
    background: var(--bg-elevated);
    color: var(--primary);
}

.notif-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Date group headers */
.notification-date-group {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 4px 8px;
    margin-top: 8px;
}

.notification-date-group:first-child {
    margin-top: 0;
    padding-top: 0;
}

.notifications-list .notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.15s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.notifications-list .notification-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

/* Type-based notification backgrounds */
.notifications-list .notification-item.type-follow {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-surface) 100%);
    border-color: rgba(59, 130, 246, 0.15);
}

.notifications-list .notification-item.type-like,
.notifications-list .notification-item.type-vote {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-surface) 100%);
    border-color: rgba(239, 68, 68, 0.15);
}

.notifications-list .notification-item.type-reply,
.notifications-list .notification-item.type-mention {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, var(--bg-surface) 100%);
    border-color: rgba(34, 197, 94, 0.15);
}

.notifications-list .notification-item.type-system,
.notifications-list .notification-item.type-announcement,
.notifications-list .notification-item.type-episode {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-surface) 100%);
    border-color: rgba(139, 92, 246, 0.15);
}

.notifications-list .notification-item.type-gift {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-surface) 100%);
    border-color: rgba(245, 158, 11, 0.15);
}

.notifications-list .notification-item.unread {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12) 0%, rgba(var(--primary-rgb), 0.04) 100%);
    border-color: rgba(var(--primary-rgb), 0.25);
}

.notifications-list .notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), rgba(var(--primary-rgb), 0.6));
    border-radius: 3px 0 0 3px;
}

/* Type-specific unread indicators */
.notifications-list .notification-item.type-follow.unread::before {
    background: linear-gradient(180deg, #3b82f6, rgba(59, 130, 246, 0.6));
}

.notifications-list .notification-item.type-like.unread::before,
.notifications-list .notification-item.type-vote.unread::before {
    background: linear-gradient(180deg, #ef4444, rgba(239, 68, 68, 0.6));
}

.notifications-list .notification-item.type-reply.unread::before,
.notifications-list .notification-item.type-mention.unread::before {
    background: linear-gradient(180deg, #22c55e, rgba(34, 197, 94, 0.6));
}

.notifications-list .notification-item.type-system.unread::before,
.notifications-list .notification-item.type-announcement.unread::before {
    background: linear-gradient(180deg, #8b5cf6, rgba(139, 92, 246, 0.6));
}

.notifications-list .notification-item.type-gift.unread::before {
    background: linear-gradient(180deg, #f59e0b, rgba(245, 158, 11, 0.6));
}

/* Read notification styles - more muted appearance */
.notifications-list .notification-item:not(.unread) {
    opacity: 0.65;
}

.notifications-list .notification-item:not(.unread):hover {
    opacity: 0.85;
}

.notifications-list .notification-item:not(.unread) .notification-thumbnail img {
    filter: grayscale(30%);
}

.notifications-list .notification-item:not(.unread):hover .notification-thumbnail img {
    filter: grayscale(0%);
}

/* Notification thumbnail for anime/user images */
.notifications-list .notification-thumbnail {
    width: 40px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.notifications-list .notification-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notifications-list .notification-thumbnail.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

/* User badge rings for supporter tiers */
.notifications-list .notification-thumbnail.user-avatar.badge-supporter {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.notifications-list .notification-thumbnail.user-avatar.badge-super_supporter {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.notifications-list .notification-thumbnail.user-avatar.badge-ultra_supporter {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3), 0 0 12px rgba(245, 158, 11, 0.2);
}

/* User badge indicator dot */
.notifications-list .notification-user-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.notifications-list .notification-user-badge.badge-supporter {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notifications-list .notification-user-badge.badge-super_supporter {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.notifications-list .notification-user-badge.badge-ultra_supporter {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.notifications-list .notification-visual.is-user {
    position: relative;
}

.notifications-list .notification-thumbnail .thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
}

.notifications-list .notification-thumbnail .thumbnail-placeholder svg {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

/* Episode notification placeholder */
.notifications-list .notification-thumbnail .thumbnail-placeholder.type-episode {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.05) 100%);
    color: #8b5cf6;
}

.notifications-list .notification-thumbnail .thumbnail-placeholder.type-episode svg {
    opacity: 0.8;
    width: 28px;
    height: 28px;
}

/* Icon badge that overlays the thumbnail */
.notifications-list .notification-icon-badge {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notifications-list .notification-icon-badge svg {
    width: 14px;
    height: 14px;
}

.notifications-list .notification-icon-badge.type-follow {
    background: #3b82f6;
    color: white;
}

.notifications-list .notification-icon-badge.type-like,
.notifications-list .notification-icon-badge.type-vote {
    background: #ef4444;
    color: white;
}

.notifications-list .notification-icon-badge.type-reply,
.notifications-list .notification-icon-badge.type-mention {
    background: #22c55e;
    color: white;
}

.notifications-list .notification-icon-badge.type-system,
.notifications-list .notification-icon-badge.type-announcement {
    background: #8b5cf6;
    color: white;
}

.notifications-list .notification-icon-badge.type-gift {
    background: #f59e0b;
    color: white;
}

.notifications-list .notification-icon-badge.type-episode {
    background: #8b5cf6;
    color: white;
}

/* Notification icon with type-based colors */
.notifications-list .notification-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.notifications-list .notification-icon.type-follow {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.notifications-list .notification-icon.type-like,
.notifications-list .notification-icon.type-vote {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.notifications-list .notification-icon.type-reply,
.notifications-list .notification-icon.type-mention {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.notifications-list .notification-icon.type-system,
.notifications-list .notification-icon.type-announcement {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.notifications-list .notification-icon.type-gift {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.notifications-list .notification-icon.type-episode {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
}

.notifications-list .notification-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.notifications-list .notification-icon svg {
    width: 20px;
    height: 20px;
}

.notifications-list .notification-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.notifications-list .notification-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notifications-list .notification-content {
    flex: 1;
    min-width: 0;
}

.notifications-list .notification-content h5,
.notifications-list .notification-body h5 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notifications-list .notification-content h5 strong {
    color: var(--primary);
    font-weight: 600;
}

.notifications-list .notification-content p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notifications-list .notification-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notifications-list .notification-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    opacity: 0.8;
}

.notifications-list .notification-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.notifications-list .notification-item:hover .notification-actions {
    opacity: 1;
}

.notification-dismiss-btn {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.6;
}

.notification-dismiss-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    opacity: 1;
}

.notification-dismiss-btn svg {
    width: 12px;
    height: 12px;
}

/* Animation for removing notifications */
.notifications-list .notification-item.removing {
    animation: notif-remove 0.3s ease forwards;
}

@keyframes notif-remove {
    0% {
        opacity: 1;
        transform: translateX(0);
        max-height: 80px;
    }
    50% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 0;
        transform: translateX(20px);
        max-height: 0;
        padding: 0;
        margin: 0;
        border-width: 0;
    }
}

/* Animation for new notifications */
.notifications-list .notification-item.new {
    animation: notif-new 0.4s ease;
}

@keyframes notif-new {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.notifications-list .notification-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.notifications-list .notification-empty svg {
    width: 36px;
    height: 36px;
    opacity: 0.25;
    margin: 0;
}

/* ===== SETTINGS TAB ===== */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 8px 0;
}

@media (max-width: 600px) {
    .settings-container {
        padding: 0;
    }

    .settings-card {
        border-radius: 12px;
    }
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section-title svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.settings-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 20px;
    background: var(--bg-surface);
    border: 1px solid transparent;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.15);
}

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

.setting-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.setting-control {
    flex-shrink: 0;
}

.setting-control select {
    padding: 10px 40px 10px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all 0.2s;
    min-width: 160px;
}

.setting-control select:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.setting-control select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

@media (max-width: 600px) {
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px 20px;
    }

    .setting-control {
        width: 100%;
    }

    .setting-control select {
        width: 100%;
    }

    .setting-control-wide {
        width: 100%;
    }
}

.btn-setting {
    padding: 10px 24px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-setting:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-setting:active {
    transform: translateY(0);
}

.btn-setting.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.btn-setting.btn-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.setting-control-wide {
    display: flex;
    gap: 12px;
    align-items: center;
}

.setting-input {
    padding: 10px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 200px;
    transition: all 0.2s;
}

.setting-input:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-elevated);
}

.setting-input::placeholder {
    color: var(--text-muted);
}

/* Contenteditable placeholder (used on username input to avoid browser autofill) */
.setting-input[contenteditable]:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

@media (max-width: 600px) {
    .setting-control-wide {
        flex-direction: column;
        width: 100%;
    }

    .setting-input {
        width: 100%;
        min-width: unset;
    }
}

/* Accent Color Picker */
.accent-color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.accent-color-picker input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.accent-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.accent-color-picker input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.btn-setting.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-setting.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-setting.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: var(--bg-deep);
}

.btn-setting.btn-danger-ghost {
    background: transparent;
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.btn-setting.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Name Color Preview */
.name-color-preview {
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 60px;
}

/* Name Flair Card (unified color + effects) */
.setting-row-full {
    flex-direction: column;
    align-items: stretch;
}

.setting-row-full .setting-info {
    margin-bottom: 12px;
}

.name-flair-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.name-flair-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.name-flair-preview-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.name-flair-preview-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.name-flair-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.name-flair-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.color-mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.color-mode-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.color-mode-btn.active {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
}

.name-flair-colors {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-row label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 50px;
}

.color-picker-row input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.effect-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.effect-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.effect-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.effect-option.active {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.effect-color-row {
    margin-top: 4px;
}

.name-flair-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Frame Style Picker */
.frame-style-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.frame-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-deep);
    cursor: pointer;
    transition: all 0.2s;
}

.frame-option:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
}

.frame-option.active {
    border-color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.frame-option span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.frame-option.active span {
    color: var(--primary);
}

.frame-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-preview-inner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
}

.frame-preview.frame-default {
    border: 2px solid var(--border);
}

.frame-preview.frame-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 3px;
}

.frame-preview.frame-cyan {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    padding: 3px;
}

.frame-preview.frame-pink {
    background: linear-gradient(135deg, #ec4899, #db2777);
    padding: 3px;
}

.frame-preview.frame-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    padding: 3px;
}

.frame-preview.frame-gradient {
    background: linear-gradient(135deg, #22d3ee, #ec4899, #f59e0b);
    padding: 3px;
}

.frame-preview.frame-animated {
    background: conic-gradient(from var(--frame-angle, 0deg), #22d3ee, #f472b6, #fbbf24, #22d3ee);
    padding: 3px;
    animation: frameAngle 4s linear infinite;
}

.frame-preview.frame-custom {
    background: var(--frame-custom-color, #8b5cf6);
    padding: 3px;
}

.frame-option #frameColorInput {
    position: absolute;
    width: 0;
    height: 0;
    padding: 0;
    border: none;
    opacity: 0;
    pointer-events: none;
}

.frame-gradient-colors {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.frame-gradient-colors .color-picker-row {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.frame-gradient-colors .color-picker-row label {
    font-size: 0.75rem;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .frame-style-picker {
        gap: 8px;
    }
    .frame-option {
        padding: 6px;
    }
    .frame-preview {
        width: 40px;
        height: 40px;
    }
    .frame-preview-inner {
        width: 30px;
        height: 30px;
    }
}

.setting-row.setting-danger {
    background: rgba(239, 68, 68, 0.03);
}

.setting-row.setting-danger:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.setting-row.setting-danger .setting-info h4 {
    color: #f87171;
}

/* Disabled settings (e.g., age-restricted) */
.setting-row.setting-disabled {
    opacity: 0.6;
}

.setting-row.setting-disabled .toggle-switch {
    pointer-events: none;
}

.setting-row.setting-disabled .toggle-slider {
    background-color: var(--surface-light) !important;
    cursor: not-allowed;
}

.setting-row.setting-disabled .toggle-slider::before {
    background-color: var(--text-muted);
}

/* Setting value display (read-only text) */
.setting-value {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Profile Settings */
.setting-row-vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.setting-row-vertical:hover {
    background: transparent;
}

.setting-row-vertical .setting-info {
    width: 100%;
}

.profile-about-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s;
}

.profile-about-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-elevated);
}

.profile-about-input::placeholder {
    color: var(--text-muted);
}

.btn-save-about,
.btn-save-signature {
    align-self: flex-end;
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    padding: 10px 28px;
}

.btn-save-about:hover,
.btn-save-signature:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-area-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.upload-dropzone {
    width: 140px;
    height: 140px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 16px;
    gap: 8px;
    background: var(--bg-deep);
}

.upload-dropzone svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
    opacity: 0.7;
    transition: all 0.2s;
}

.upload-dropzone:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
    color: var(--primary);
}

.upload-dropzone:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

.upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-subtle);
    transform: scale(1.02);
}

.upload-dropzone-banner {
    width: 100%;
    height: 100px;
}

.upload-preview {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.upload-preview:hover {
    border-color: var(--primary-muted);
}

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

.upload-preview-banner {
    width: 100%;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    margin-top: 12px;
    display: none;
}

.upload-preview-banner.has-image {
    display: block;
}

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

/* Compact Profile Images Row */
.profile-images-row {
    display: flex;
    gap: 16px;
    width: 100%;
}

.image-upload-compact {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
}

.image-upload-compact:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.image-upload-compact.image-upload-banner {
    flex: 1;
    width: auto;
    min-width: 200px;
}

.upload-preview-inline {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    text-align: center;
    padding: 10px;
}

.upload-placeholder svg {
    width: 28px;
    height: 28px;
    opacity: 0.5;
}

.upload-placeholder span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.image-upload-compact:hover .upload-placeholder {
    color: var(--primary);
}

.image-upload-compact:hover .upload-placeholder svg {
    opacity: 0.8;
}

.image-upload-compact.has-image {
    border-style: solid;
    border-color: var(--border);
}

.image-upload-compact.has-image:hover {
    border-color: var(--primary-muted);
}

.image-upload-compact.has-image .upload-placeholder {
    display: none;
}

.image-upload-compact.dragover {
    border-color: var(--primary);
    background: var(--primary-subtle);
    transform: scale(1.02);
}

/* About Editor with Toolbar */
.about-editor-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

@media (max-width: 800px) {
    .about-editor-row {
        grid-template-columns: 1fr;
    }
}

/* About & Signature Stacked */
.about-signature-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* About Editor Horizontal (toolbar on top) */
.about-editor-horizontal {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    transition: border-color 0.2s;
}

.about-editor-horizontal:focus-within {
    border-color: var(--primary-muted);
}

.about-toolbar-horizontal {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.about-editor-horizontal .profile-about-input {
    border: none;
    border-radius: 0;
    background: var(--bg-deep);
    resize: vertical;
    min-height: 120px;
    flex: 1;
}

.about-editor-horizontal .profile-about-input:focus {
    box-shadow: none;
}

/* Signature Header (inside about-editor-horizontal) */
.signature-inline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.signature-inline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.signature-inline-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}


.about-editor {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-deep);
    display: flex;
    flex-direction: row;
    min-width: 0;
    transition: border-color 0.2s;
}

.about-editor:focus-within {
    border-color: var(--primary-muted);
}

.about-toolbar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.toolbar-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.toolbar-btn:hover {
    background: var(--primary-subtle);
    color: var(--primary);
    transform: scale(1.05);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
}

.toolbar-divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 4px 0;
    opacity: 0.6;
}

.about-editor .profile-about-input {
    border: none;
    border-radius: 0;
    background: var(--bg-deep);
    resize: none;
    min-height: 280px;
    flex: 1;
}

.about-editor .profile-about-input:focus {
    box-shadow: none;
}

/* About Preview Container */
.about-preview-container {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
    align-self: stretch;
}

.about-preview-label {
    padding: 10px 14px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.about-preview {
    padding: 16px;
    background: var(--bg-deep);
    min-height: 100px;
    flex: 1;
    overflow-y: auto;
}

/* Signature Editor (horizontal toolbar, preview below) */
.signature-editor-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.signature-editor {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}

.signature-editor:focus-within {
    border-color: var(--primary-muted);
}

.signature-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.toolbar-divider-h {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 5px 4px;
    opacity: 0.6;
    align-self: center;
}

.signature-editor .profile-about-input {
    border: none;
    border-radius: 0;
    background: var(--bg-deep);
    resize: vertical;
    min-height: 80px;
}

.signature-editor .profile-about-input:focus {
    box-shadow: none;
}

.signature-preview-container {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-deep);
}

.signature-preview-container .about-preview-label {
    padding: 8px 14px;
}

.signature-preview-container .about-preview {
    padding: 14px 16px;
    min-height: 40px;
}

/* About Rendered Content */
.about-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    word-wrap: break-word;
}

.about-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-content em {
    font-style: italic;
}

.about-content s {
    text-decoration: line-through;
    opacity: 0.7;
}

.about-content a {
    color: var(--primary);
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

.about-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.about-content h1, .about-content h2, .about-content h3 {
    color: var(--text-primary);
    margin: 16px 0 8px 0;
    font-family: var(--font-display);
}

.about-content h1 { font-size: 1.5rem; }
.about-content h2 { font-size: 1.25rem; }
.about-content h3 { font-size: 1.1rem; }

.about-content blockquote {
    border-left: 3px solid var(--primary);
    margin: 12px 0;
    padding: 8px 16px;
    background: var(--bg-deep);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.about-content code {
    background: var(--bg-deep);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.about-content pre {
    background: var(--bg-deep);
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.about-content pre code {
    background: none;
    padding: 0;
}

.about-content ul, .about-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.about-content li {
    margin: 4px 0;
}

.about-content .center {
    text-align: center;
}

.about-content .spoiler {
    background: var(--text-primary);
    color: transparent;
    border-radius: 4px;
    padding: 0 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.about-content .spoiler:hover,
.about-content .spoiler.revealed {
    background: var(--bg-deep);
    color: var(--text-secondary);
}

/* Spoiler in status bubble */
.status-bubble-text .spoiler {
    background: var(--text-primary);
    color: transparent;
    border-radius: 3px;
    padding: 0 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-bubble-text .spoiler:hover,
.status-bubble-text .spoiler.revealed {
    background: var(--bg-deep);
    color: var(--text-secondary);
}

@media (max-width: 550px) {
    .upload-area-row {
        flex-direction: column;
    }

    .upload-dropzone {
        width: 100%;
        height: 120px;
    }

    .upload-preview {
        width: 100%;
        height: 150px;
    }

    .toolbar-btn {
        width: 28px;
        height: 28px;
    }

    .toolbar-btn svg {
        width: 16px;
        height: 16px;
    }

    .profile-images-row {
        flex-direction: column;
    }

    .image-upload-compact {
        width: 100%;
        height: 80px;
    }

    .image-upload-compact.image-upload-banner {
        min-width: unset;
        height: 80px;
    }
}

.password-requirements {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-deep);
    border-radius: 8px;
}

.password-requirements p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.delete-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.delete-warning p {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.delete-warning ul {
    margin: 12px 0 0 0;
    padding-left: 20px;
}

.delete-warning li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== FOLLOW SYSTEM ===== */
.meta-badge.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.meta-badge.clickable:hover {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
}

.btn-follow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-follow svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-follow:hover {
    background: var(--primary-hover);
}

.btn-follow.following {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 10px 16px;
}

.btn-follow.following svg {
    width: 16px;
    height: 16px;
    color: var(--success);
}

.btn-follow.following:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-follow.following:hover svg {
    color: #f87171;
}

/* Follow Actions Container */
.follow-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-notify {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(var(--primary-rgb), 0.15);
    border: none;
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-notify svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.btn-notify:hover {
    background: rgba(var(--primary-rgb), 0.25);
    transform: translateY(-1px);
}

.btn-notify.muted {
    background: rgba(161, 161, 170, 0.15);
    color: #9ca3af;
}

.btn-notify.muted:hover {
    background: rgba(161, 161, 170, 0.25);
    color: var(--text-secondary);
}

/* Report User Button */
.btn-report {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: #f87171;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-report svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.btn-report:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

/* Block User Button */
.btn-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: #f87171;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-block svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.btn-block:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.btn-block.blocked {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.btn-block.blocked:hover {
    background: rgba(34, 197, 94, 0.25);
}

/* Blocked Profile Overlay */
.blocked-profile-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: var(--bg);
    min-height: 400px;
}

.blocked-profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 400px;
}

.blocked-profile-content svg {
    color: #f87171;
    opacity: 0.7;
}

.blocked-profile-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.blocked-profile-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.btn-unblock {
    margin-top: 8px;
    padding: 10px 24px;
    background: rgba(var(--primary-rgb), 0.15);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-unblock:hover {
    background: rgba(var(--primary-rgb), 0.25);
    transform: translateY(-1px);
}

/* Status Panel */
.status-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-left: 3px solid var(--accent);
}

.status-content {
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.status-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}

.status-time {
    color: var(--text-muted);
    font-size: 13px;
}

.status-delete-btn {
    background: transparent;
    border: none;
    color: #f87171;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.status-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Status Input Panel */
.status-input-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.status-input-panel textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.status-input-panel textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.status-input-panel textarea::placeholder {
    color: var(--text-muted);
}

.status-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.status-char-count {
    color: #fff;
    font-size: 13px;
}

.btn-post-status {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-post-status:hover {
    filter: brightness(1.1);
}

/* Status Thought Bubble (Discord-style) */
.status-thought-bubble,
.status-edit-bubble {
    position: absolute;
    top: -60px;
    left: 100%;
    margin-left: 8px;
    z-index: 10;
}

.thought-bubble-dots {
    position: absolute;
    bottom: -12px;
    left: -20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.thought-dot {
    background: #1a1a22;
    border: 1px solid var(--border);
    border-radius: 50%;
}

.thought-dot.dot-1 {
    width: 6px;
    height: 6px;
}

.thought-dot.dot-2 {
    width: 10px;
    height: 10px;
}

.thought-dot.dot-3 {
    width: 14px;
    height: 14px;
}

.thought-bubble-content {
    background: #1a1a22;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 120px;
    max-width: 400px;
    width: max-content;
    cursor: pointer;
    transition: all 0.2s;
}

.thought-bubble-content:hover {
    border-color: var(--primary);
}

.status-bubble-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 370px;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.status-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.status-bubble-time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Status Edit Bubble */
.status-edit-content {
    background: #1a1a22;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    min-width: 400px;
    max-width: 400px;
}

.status-edit-toolbar {
    display: flex;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.status-toolbar-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    transition: all 0.15s;
}

.status-toolbar-btn:hover {
    background: var(--bg-elevated);
    color: var(--primary);
}

.status-toolbar-btn svg {
    width: 16px;
    height: 16px;
}

.status-toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 4px 4px;
}

.status-edit-content textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

.status-edit-content textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.status-edit-content textarea::placeholder {
    color: var(--text-muted);
}

.status-edit-footer {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    gap: 10px;
}

.status-expiration-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #fff;
}

.status-expiration-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.status-expiration-select:focus {
    outline: none;
    border-color: var(--primary);
}

.status-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.status-edit-actions {
    display: flex;
    gap: 6px;
}

.btn-status-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-status-cancel:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.btn-status-delete {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-status-delete:hover {
    background: rgba(239, 68, 68, 0.15);
}

.btn-status-save {
    background: var(--accent);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-status-save:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-status-save:disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Set Status Button (when no status exists) */
.status-set-btn {
    position: absolute;
    top: -40px;
    left: 100%;
    margin-left: 8px;
    background: var(--card-bg);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-set-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.status-set-btn svg {
    width: 18px;
    height: 18px;
}

/* Status Emoji Picker */
.status-emoji-picker {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

/* About Me Emoji Picker */
.about-emoji-picker {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.emoji-category {
    margin-bottom: 12px;
}

.emoji-category:last-child {
    margin-bottom: 0;
}

.emoji-category-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.emoji-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    background: var(--bg-deep);
    transform: scale(1.15);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 26px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch:hover .toggle-slider {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
    background: white;
    transform: translateX(22px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Follow Modal */
.follow-modal {
    max-width: 400px;
}

.follow-list {
    max-height: 400px;
    overflow-y: auto;
}

.follow-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s;
}

.follow-user-card:hover {
    background: rgba(var(--primary-rgb), 0.06);
}

.follow-user-avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

.follow-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.follow-user-avatar svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.follow-user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* Blocked Users List Button */
.btn-blocked-list {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: rgba(248, 113, 113, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.btn-blocked-list svg {
    width: 16px;
    height: 16px;
}

.btn-blocked-list:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Blocked Users Modal Items */
.follow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.follow-item:hover {
    background: rgba(var(--primary-rgb), 0.06);
}

.follow-user {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.follow-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

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

.follow-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.follow-username {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-unblock-small {
    padding: 6px 12px;
    background: rgba(var(--primary-rgb), 0.15);
    border: none;
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-unblock-small:hover {
    background: rgba(var(--primary-rgb), 0.25);
}

.empty-follow-list {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .follow-actions {
        gap: 6px;
    }

    .btn-follow {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .btn-notify {
        width: 34px;
        height: 34px;
    }

    .btn-notify svg {
        width: 16px;
        height: 16px;
    }

    .btn-report {
        width: 34px;
        height: 34px;
    }

    .btn-report svg {
        width: 16px;
        height: 16px;
    }

    .btn-block {
        width: 34px;
        height: 34px;
    }

    .btn-block svg {
        width: 16px;
        height: 16px;
    }

    .status-panel {
        padding: 12px 14px;
    }

    .status-content {
        font-size: 14px;
    }

    .status-input-panel {
        padding: 12px;
    }

    .status-input-panel textarea {
        min-height: 60px;
        padding: 10px;
    }
}


/* ===== SERIES VIEW ===== */

/* View Mode Toggle (Individual/Series) */
.list-view-mode {
    display: flex;
    gap: 4px;
    background: var(--bg-surface);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.view-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-mode-btn svg {
    width: 18px;
    height: 18px;
}

.view-mode-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.view-mode-btn.active {
    background: var(--primary);
    color: white;
}

/* Fix series icon middle rect fill when active */
.view-mode-btn.active svg rect[fill] {
    fill: var(--primary);
}

/* Series List Container */
.series-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Series Card - Enhanced */
.series-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.25s ease;
    position: relative;
}

.series-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px);
}

.series-card.expanded {
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.2);
}

/* Series Card - Selection styles */
.series-card.selected {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.series-card.selected::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.15);
    pointer-events: none;
    border-radius: 14px;
    z-index: 5;
}

/* Series card checkbox positioning */
.series-card > .select-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

/* Disable hover effects and make selection instant in select mode for series-card list view */
body.select-mode-active .series-card {
    transition: none !important;
}

body.select-mode-active .series-card:hover {
    transform: none;
}

/* Series Header (clickable) */
.series-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 12px 16px;
    padding: 16px;
    cursor: pointer;
}

/* Single Cover Image (List View) */
.series-cover-wrap {
    flex-shrink: 0;
    grid-row: span 2;
}

.series-cover-single {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.series-card:hover .series-cover-single {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

/* Stacked Cover Images (Grid View) */
.series-covers {
    display: flex;
    flex-shrink: 0;
    grid-row: span 2;
}

.series-cover-mini {
    width: 48px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--bg-card);
    margin-left: -15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.series-cover-mini:first-child {
    margin-left: 0;
}

.series-card:hover .series-cover-mini {
    margin-left: -10px;
    transform: translateY(-2px);
}

.series-card:hover .series-cover-mini:first-child {
    margin-left: 0;
}

/* Series Info (Title + Meta) */
.series-info {
    min-width: 0;
}

.series-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.series-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.series-count {
    color: #9ca3af;
}

/* Series Stats - Enhanced */
.series-stats {
    display: flex;
    gap: 20px;
    grid-row: span 2;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 10px;
}

.series-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.series-stat .stat-value {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.series-card:hover .series-stat .stat-value {
    color: var(--primary);
}

.series-stat .stat-label {
    font-size: 0.6rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Series Progress Bar - Enhanced */
.series-progress-bar {
    grid-column: 2 / -2;
    height: 5px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.series-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
}

/* Expand Button - Enhanced */
.series-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    grid-row: span 2;
}

.series-expand-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.series-card.expanded .series-expand-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.series-expand-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.series-expand-btn svg.rotated {
    transform: rotate(180deg);
}

/* Expanded Entries - Enhanced */
.series-entries {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding-top: 14px;
    background: linear-gradient(180deg, var(--bg-surface) 0%, transparent 100%);
}

.series-entry {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.series-entry:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-muted);
    transform: translateX(4px);
}

.entry-cover {
    width: 44px;
    height: 62px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.series-entry:hover .entry-cover {
    transform: scale(1.05);
}

.entry-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.series-entry:hover .entry-title {
    color: var(--primary);
}

.entry-progress {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
}

.entry-score {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    padding: 4px 10px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 6px;
}

.btn-edit-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.series-entry:hover .btn-edit-entry {
    opacity: 1;
}

.btn-edit-entry:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.btn-edit-entry svg {
    width: 16px;
    height: 16px;
}

/* Not in List Section */
.not-in-list-section {
    border-top: 1px dashed var(--border);
    padding-top: 12px;
    margin-top: 8px;
}

.not-in-list-section .series-section-header {
    color: #9ca3af;
}

.not-in-list-count {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    background: rgba(107, 114, 128, 0.2);
    border-radius: 4px;
    color: #9ca3af;
    margin-left: 6px;
}

.series-entry.not-in-list {
    opacity: 0.7;
    border-style: dashed;
}

.series-entry.not-in-list:hover {
    opacity: 1;
}

.series-entry.not-in-list .entry-cover {
    filter: grayscale(30%);
}

.series-entry.not-in-list:hover .entry-cover {
    filter: none;
}

.btn-add-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-entry:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.btn-add-entry svg {
    width: 18px;
    height: 18px;
}

/* Series List View - Expanded Content (scoped to series cards only) */
.series-card .list-expanded-content {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    border-top: 1px solid var(--border);
}

.list-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-section-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.list-section-count {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 10px;
    margin-left: auto;
}

.list-section.not-in-list {
    opacity: 0.7;
    border-top: 1px dashed var(--border);
    padding-top: 16px;
    margin-top: 4px;
}

.list-section.not-in-list .list-section-count {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Subsections within Not in List */
.list-subsection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.list-subsection:first-child {
    margin-top: 8px;
}

.list-subsection-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 4px;
}

.list-subsection-header .list-section-count {
    font-size: 0.6rem;
    padding: 1px 6px;
}

.list-entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

/* List Entry Card */
.list-entry-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-entry-card:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-muted);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.list-entry-cover {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.list-entry-card:hover .list-entry-cover {
    transform: scale(1.05);
}

.list-entry-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.list-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.list-entry-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.list-entry-card:hover .list-entry-title {
    color: var(--primary);
}

.list-entry-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.list-entry-score {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    padding: 2px 6px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 4px;
}

.list-entry-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}

.list-entry-card:hover .list-entry-edit {
    opacity: 1;
}

.list-entry-edit:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.list-entry-edit svg {
    width: 14px;
    height: 14px;
}

.list-entry-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.list-entry-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 100px;
}

.list-entry-eps {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.list-entry-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    min-width: 40px;
}

.list-entry-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.list-entry-format {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    padding: 2px 6px;
    background: var(--bg-surface);
    border-radius: 4px;
    text-transform: uppercase;
}

/* Not in list variant */
.list-entry-card.not-in-list {
    opacity: 0.7;
    border-style: dashed;
}

.list-entry-card.not-in-list:hover {
    opacity: 1;
}

.list-entry-card.not-in-list .list-entry-cover {
    filter: grayscale(30%);
}

.list-entry-card.not-in-list:hover .list-entry-cover {
    filter: none;
}

.list-entry-add {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.list-entry-add:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.list-entry-add svg {
    width: 12px;
    height: 12px;
}

/* Status badge small variant */
.status-badge.sm {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Responsive Series Cards */
@media (max-width: 768px) {
    .series-card:hover {
        transform: none;
    }

    .series-header {
        grid-template-columns: auto 1fr auto;
        gap: 10px 12px;
    }

    .series-stats {
        grid-column: 1 / -1;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 10px;
    }

    .series-progress-bar {
        grid-column: 1 / -1;
    }

    .series-expand-btn {
        grid-row: 1;
        width: 32px;
        height: 32px;
    }

    .series-cover-single {
        width: 50px;
        height: 70px;
    }

    .series-cover-mini {
        width: 40px;
        height: 56px;
        margin-left: -12px;
    }

    /* Responsive list view */
    .list-expanded-content {
        padding: 12px;
    }

    .list-entries-grid {
        grid-template-columns: 1fr;
    }

    .list-entry-card {
        padding: 8px;
    }

    .list-entry-cover {
        width: 45px;
        height: 63px;
    }

    .list-entry-title {
        font-size: 0.8rem;
    }

    .list-entry-progress {
        min-width: 80px;
    }

    .series-title {
        font-size: 0.9rem;
    }

    .series-stat .stat-value {
        font-size: 0.85rem;
    }

    .series-entry:hover {
        transform: none;
    }

    .entry-cover {
        width: 38px;
        height: 54px;
    }

    .btn-edit-entry {
        opacity: 1;
    }

    /* Enhanced list view responsive */
    .list-item {
        grid-template-columns: 70px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .list-item:hover {
        transform: none;
    }

    .item-cover {
        width: 70px;
        height: 100px;
    }

    .item-header {
        flex-wrap: nowrap;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .item-format {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .item-meta-row {
        font-size: 0.75rem;
    }

    .item-stats {
        gap: 14px;
    }

    .item-stat-value {
        font-size: 0.85rem;
    }

    .item-stat-label {
        font-size: 0.6rem;
    }

    .item-actions {
        position: absolute;
        top: 12px;
        right: 12px;
        flex-direction: row;
        gap: 6px;
    }

    .btn-increment, .btn-edit {
        width: 32px;
        height: 32px;
    }

    .btn-increment svg, .btn-edit svg {
        width: 14px;
        height: 14px;
    }
}

/* === SERIES SECTIONS (Main Story / Related) === */
.series-section {
    margin-bottom: 12px;
}

.series-section:last-child {
    margin-bottom: 0;
}

.series-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    padding: 8px 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.series-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.related-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.related-section .series-section-header {
    color: #9ca3af;
}

.related-count {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 6px;
    background: var(--bg-elevated);
    border-radius: 10px;
    color: var(--text-secondary);
}

.series-entries-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* === SERIES GRID VIEW (using oku-series-card) === */
.series-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 16px 0;
}

/* Wrapper for selection functionality */
.series-grid-card-wrapper {
    position: relative;
}

.series-grid-card-wrapper.selected .oku-series-card {
    box-shadow: 0 0 0 2px var(--primary, #8b5cf6),
                0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Grid View Responsive - oku-series-card */
@media (max-width: 768px) {
    .series-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .series-grid-view {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* === SERIES DETAIL MODAL === */
.series-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.series-detail-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.series-detail-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.85);
}

.series-detail-content {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: var(--bg-deep);
    border-radius: 16px;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border);
}

.series-detail-overlay.active .series-detail-content {
    transform: scale(1) translateY(0);
}

.series-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.series-detail-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.series-detail-close svg {
    width: 18px;
    height: 18px;
    color: white;
}

.series-detail-header {
    position: relative;
    flex-shrink: 0;
    background: var(--bg-surface);
}

.series-detail-banner {
    height: 240px;
    background-size: cover;
    background-position: center 30%;
    position: relative;
}

.series-detail-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 40%,
        var(--bg-deep) 100%
    );
}

.series-detail-info {
    position: relative;
    padding: 0 24px 16px;
    margin-top: -50px;
    z-index: 5;
}

.series-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
    line-height: 1.3;
}

.series-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.series-detail-meta .meta-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.series-detail-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.series-detail-stats .stat-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.series-detail-stats .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.series-detail-stats .stat-label {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.series-detail-stats .score-star {
    color: #fbbf24;
}

.series-detail-stats .stat-value:has(.score-star) {
    color: #fbbf24;
}

/* Tabs */
.series-detail-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.series-detail-tab {
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.series-detail-tab:hover {
    color: var(--text-primary);
}

.series-detail-tab.active {
    color: var(--primary);
}

.series-detail-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

.series-detail-tab .tab-count {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 6px;
}

.series-detail-tab.active .tab-count {
    color: var(--primary);
}

.series-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 24px;
    background: var(--bg-deep);
}

.series-tab-content {
    display: none;
}

.series-tab-content.active {
    display: block;
}

.series-detail-section {
    margin-bottom: 20px;
}

.series-detail-section:last-child {
    margin-bottom: 0;
}

.series-detail-section .section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 12px 0;
}

/* Entry Cards - Compact List Style */
.series-entries-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.series-entry-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.series-entry-card:hover {
    background: var(--bg-elevated);
}

.series-entry-card .entry-cover {
    width: 44px;
    height: 62px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.series-entry-card .entry-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.series-entry-card .entry-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.series-entry-card .entry-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.series-entry-card .entry-format {
    font-size: 0.65rem;
    color: #9ca3af;
    padding: 2px 6px;
    background: var(--bg-elevated);
    border-radius: 4px;
    text-transform: uppercase;
}

.series-entry-card .entry-year {
    font-size: 0.75rem;
    color: #9ca3af;
}

.series-entry-card .entry-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.series-entry-card .entry-progress-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    min-width: 70px;
}

.series-entry-card .progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.series-entry-card .progress-bar {
    width: 70px;
    height: 3px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
}

.series-entry-card .progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.series-entry-card .entry-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 40px;
}

.series-entry-card .status-badge.sm {
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Not in list card variant */
.series-entry-card.not-in-list {
    opacity: 0.7;
}

.series-entry-card.not-in-list:hover {
    opacity: 1;
}

.series-entry-card .entry-episodes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
}

.series-entry-card .add-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.series-entry-card .add-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.series-entry-card .entry-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.series-entry-card .entry-link:hover .entry-title {
    color: var(--primary);
}

.series-entry-card .edit-btn {
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.series-entry-card .edit-btn svg {
    width: 14px;
    height: 14px;
}

.series-entry-card .edit-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
}

/* Format badge colors */
.entry-format-badge.format-tv,
.entry-format-badge.format-ona {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-light);
}

.entry-format-badge.format-movie {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}

.entry-format-badge.format-ova {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.entry-format-badge.format-special {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.entry-format-badge.format-music {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.entry-format-badge.format-other {
    background: var(--bg-elevated);
    color: #9ca3af;
}

/* Format badge in meta */
.series-entry-card .entry-format-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Episode count in meta */
.series-entry-card .entry-eps {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* Format classes (no longer using colored left borders) */

/* Story section labels (Main Story / Specials / Side Stories) */
.story-section {
    margin-bottom: 16px;
}

.story-section:last-child {
    margin-bottom: 0;
}

.story-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    padding: 4px 0;
    margin-bottom: 8px;
}

.story-section.main-story .story-section-label {
    color: var(--primary);
}

.story-section.specials .story-section-label,
.story-section.side-stories .story-section-label {
    color: #9ca3af;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.empty-message {
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 30px 20px;
    text-align: center;
}

/* Body lock when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Series Detail Modal Responsive */
@media (max-width: 768px) {
    .series-detail-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .series-detail-banner {
        height: 180px;
    }

    .series-detail-info {
        padding: 0 16px 12px;
        margin-top: -40px;
    }

    .series-detail-title {
        font-size: 1.15rem;
    }

    .series-detail-stats {
        gap: 12px;
        padding: 10px 12px;
    }

    .series-detail-stats .stat-value {
        font-size: 0.95rem;
    }

    .series-detail-tabs {
        padding: 0 16px;
    }

    .series-detail-tab {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .series-detail-body {
        padding: 16px;
    }

    .series-entry-card {
        padding: 8px 10px;
        gap: 10px;
    }

    .series-entry-card .entry-cover {
        width: 36px;
        height: 50px;
    }

    .series-entry-card .entry-title {
        font-size: 0.85rem;
    }

    .series-entry-card .entry-stats {
        gap: 10px;
    }

    .series-entry-card .entry-progress-compact {
        min-width: 55px;
    }

    .series-entry-card .progress-bar {
        width: 55px;
    }
}

/* === BULK OPERATIONS & MULTI-SELECT === */

/* Bulk Action Bar */
.bulk-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: #1a1a24;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 1000;
}

.bulk-action-bar.visible {
    display: flex;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding-right: 16px;
    border-right: 1px solid var(--border);
}

.bulk-info #selectedCount {
    font-weight: 600;
    color: var(--primary);
}

.btn-select-all, .btn-deselect-all {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-select-all:hover, .btn-deselect-all:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.bulk-actions {
    display: flex;
    gap: 8px;
}

.bulk-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-btn svg {
    width: 16px;
    height: 16px;
}

.bulk-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
}

.bulk-btn.danger {
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.3);
}

.bulk-btn.danger:hover {
    background: rgba(255, 71, 87, 0.1);
    border-color: #ff4757;
}

.bulk-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #9ca3af;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.bulk-close:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.bulk-close svg {
    width: 20px;
    height: 20px;
}

/* Select Checkbox */
.select-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: #1a1a24;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    transition: all 0.2s ease;
}

.select-checkbox svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    color: white;
    transition: opacity 0.2s ease;
}

.select-checkbox:hover {
    border-color: var(--primary);
}

.select-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.select-checkbox.checked svg {
    opacity: 1;
}

/* Selected state for cards */
body.select-mode-active .oku-card-wrapper .oku-card-image {
    transition: none !important;
}
body.select-mode-active .oku-card-wrapper:hover img {
    transform: none !important;
}
body.select-mode-active .oku-card-slide {
    display: none !important;
}

.oku-card-wrapper .select-checkbox {
    top: 8px;
    left: 8px;
}

.list-item {
    position: relative;
}

.list-item.selected {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
}

.list-item .select-checkbox {
    position: relative;
    top: auto;
    left: auto;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Danger Modal Styling */
.danger-modal .modal-header h3 {
    color: #ff4757;
}

.danger-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.danger-icon svg {
    width: 64px;
    height: 64px;
    color: #ff4757;
}

.confirm-count {
    color: var(--text-secondary);
    margin: 8px 0;
}

.confirm-warning {
    color: #ff4757;
    font-weight: 500;
    margin-top: 12px;
}

.confirm-hint {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 8px;
}

/* Body padding when bulk bar is visible */
body.select-mode-active {
    padding-bottom: 100px;
}

/* Responsive bulk action bar */
@media (max-width: 768px) {
    .bulk-action-bar {
        left: 16px;
        right: 16px;
        transform: none;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px;
    }

    .bulk-info {
        flex: 1;
        padding-right: 0;
        border-right: none;
    }

    .btn-select-all, .btn-deselect-all {
        font-size: 0.75rem;
        padding: 2px 6px;
    }

    .bulk-actions {
        width: 100%;
        justify-content: center;
    }

    .bulk-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .bulk-close {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
    }
}

/* ===== MOBILE RESPONSIVE - NOTIFICATIONS TAB ===== */

/* Tablet/Mobile - 768px */
@media (max-width: 768px) {
    .notifications-container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .notifications-header {
        padding: 12px 16px !important;
        margin-bottom: 8px !important;
    }

    .notifications-header h2 {
        font-size: 1.2rem !important;
    }

    .notif-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .notif-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    .notifications-list {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .notifications-list .notification-item {
        padding: 12px 14px !important;
        gap: 10px !important;
        position: relative !important;
    }

    .notifications-list .notification-item.unread::before {
        width: 3px !important;
    }

    /* Thumbnail responsive */
    .notifications-list .notification-thumbnail {
        width: 42px !important;
        height: 58px !important;
    }

    .notifications-list .notification-thumbnail.user-avatar {
        width: 42px !important;
        height: 42px !important;
    }

    .notifications-list .notification-content h5,
    .notifications-list .notification-body h5 {
        font-size: 0.9rem !important;
        margin: 0 !important;
        line-height: 1.35 !important;
    }

    .notifications-list .notification-content p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }

    .notifications-list .notification-time {
        font-size: 0.72rem !important;
    }

    .notifications-list .notification-empty {
        padding: 60px 20px !important;
        font-size: 1rem !important;
    }
}

/* Small Mobile - 600px */
@media (max-width: 600px) {
    .notifications-header {
        padding: 10px 12px !important;
    }

    .notifications-header h2 {
        font-size: 1.1rem !important;
    }

    .notif-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .notifications-list .notification-item {
        padding: 10px 12px !important;
        gap: 10px !important;
    }

    .notifications-list .notification-item.unread::before {
        width: 3px !important;
    }

    /* Thumbnail small mobile */
    .notifications-list .notification-thumbnail {
        width: 36px !important;
        height: 50px !important;
    }

    .notifications-list .notification-thumbnail.user-avatar {
        width: 36px !important;
        height: 36px !important;
    }

    .notifications-list .notification-content h5,
    .notifications-list .notification-body h5 {
        font-size: 0.85rem !important;
        margin: 0 !important;
    }

    .notifications-list .notification-content p {
        font-size: 0.8rem !important;
    }

    .notifications-list .notification-time {
        font-size: 0.7rem !important;
    }

    .notifications-list .notification-empty {
        padding: 48px 16px !important;
        font-size: 0.95rem !important;
    }
}

/* Extra Small Mobile - 480px */
@media (max-width: 480px) {
    .notifications-header {
        padding: 8px 10px !important;
    }

    .notifications-header h2 {
        font-size: 1rem !important;
    }

    .notif-btn {
        width: 28px !important;
        height: 28px !important;
    }

    .notif-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .notifications-list .notification-item {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .notifications-list .notification-item.unread::before {
        width: 3px !important;
    }

    .notifications-list .notification-thumbnail {
        width: 32px !important;
        height: 44px !important;
    }

    .notifications-list .notification-thumbnail.user-avatar {
        width: 32px !important;
        height: 32px !important;
    }

    .notifications-list .notification-content h5,
    .notifications-list .notification-body h5 {
        font-size: 0.8rem !important;
        margin: 0 !important;
    }

    .notifications-list .notification-time {
        font-size: 0.65rem !important;
    }

    .notifications-list .notification-empty {
        padding: 40px 12px !important;
        font-size: 0.9rem !important;
    }
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 320px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

@media (max-width: 600px) {
    .toast-container {
        left: 12px;
        right: 12px;
        top: 70px;
    }

    .toast {
        max-width: none;
    }
}

/* =========================================
   ENHANCED STATS PAGE (AniList-style)
   ========================================= */

/* Stats Layout with Sidebar */
.stats-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
}

.stats-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 74px;
    align-self: start;
    z-index: 10;
}

.stats-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
}

.stats-nav-item {
    padding: 12px 14px;
    background: none;
    border: none;
    border-radius: 8px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.stats-nav-item.active {
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 600;
}

.stats-content {
    min-width: 0;
}

.stats-page {
    display: none;
    animation: statsFadeIn 0.25s ease;
}

.stats-page.active {
    display: block;
}

@keyframes statsFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered animation for stat cards */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Removed scaleY animation - now using height transition for fill-up effect */

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

/* Animated stat cards */
.stat-card.animate-in {
    animation: cardSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

/* Stagger delays using CSS custom properties */
.stat-card.animate-in:nth-child(1) { animation-delay: 0ms; }
.stat-card.animate-in:nth-child(2) { animation-delay: 30ms; }
.stat-card.animate-in:nth-child(3) { animation-delay: 60ms; }
.stat-card.animate-in:nth-child(4) { animation-delay: 90ms; }
.stat-card.animate-in:nth-child(5) { animation-delay: 120ms; }
.stat-card.animate-in:nth-child(6) { animation-delay: 150ms; }
.stat-card.animate-in:nth-child(7) { animation-delay: 180ms; }
.stat-card.animate-in:nth-child(8) { animation-delay: 210ms; }
.stat-card.animate-in:nth-child(9) { animation-delay: 240ms; }
.stat-card.animate-in:nth-child(10) { animation-delay: 270ms; }
.stat-card.animate-in:nth-child(n+11) { animation-delay: 300ms; }

/* Animated vertical bar columns */
.vbar-col.animate-in {
    animation: cardSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.vbar-col.animate-in:nth-child(1) { animation-delay: 0ms; }
.vbar-col.animate-in:nth-child(2) { animation-delay: 40ms; }
.vbar-col.animate-in:nth-child(3) { animation-delay: 80ms; }
.vbar-col.animate-in:nth-child(4) { animation-delay: 120ms; }
.vbar-col.animate-in:nth-child(5) { animation-delay: 160ms; }
.vbar-col.animate-in:nth-child(6) { animation-delay: 200ms; }
.vbar-col.animate-in:nth-child(7) { animation-delay: 240ms; }
.vbar-col.animate-in:nth-child(8) { animation-delay: 280ms; }
.vbar-col.animate-in:nth-child(9) { animation-delay: 320ms; }
.vbar-col.animate-in:nth-child(10) { animation-delay: 360ms; }

/* Bar fill animations moved to main .vbar-fill rule below */

/* Value counter animation */
.stat-box-value.animate-value,
.vbar-value.animate-value {
    animation: valueCountUp 0.3s ease forwards;
}

/* Chart mode transition */
.chart-transitioning {
    opacity: 0.5;
    transform: scale(0.98);
    transition: all 0.15s ease;
}

/* Year timeline bar animations */
.ytl-bar.animate-in {
    animation: cardSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

/* Year timeline fill animations in main .ytl-fill rule above */

.stats-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.stats-page-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart Toggle Buttons */
.chart-toggle-group {
    display: flex;
    gap: 2px;
    background: var(--bg-deep);
    padding: 3px;
    border-radius: 8px;
}

.chart-toggle-group.mini {
    padding: 2px;
}

.chart-toggle {
    padding: 8px 14px;
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chart-toggle-group.mini .chart-toggle {
    padding: 5px 10px;
    font-size: 0.7rem;
}

.chart-toggle:hover {
    color: var(--text-primary);
}

.chart-toggle.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.card-header-with-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.card-header-with-toggle h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* AniList-style Vertical Bar Charts */
.vertical-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 20px 8px 0;
    gap: 6px;
}

.vbar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 70px;
    min-width: 28px;
    transition: transform 0.2s ease;
    position: relative;
}

.vbar-col:hover {
    transform: translateY(-2px);
}

.vbar-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    min-height: 18px;
}

.vbar-track {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--bg-deep);
    border-radius: 6px;
    overflow: hidden;
}

.vbar-fill {
    width: 80%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transform-origin: bottom;
    transition: height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease, transform 0.2s ease;
}

.vbar-fill.animate-fill {
    height: 0 !important;
}

.vbar-col:hover .vbar-fill {
    filter: brightness(1.2);
    transform: scaleY(1.02);
}

.vbar-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
}

.vbar-col:hover .vbar-label {
    color: var(--primary);
    font-weight: 600;
}

.vbar-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vbar-col:hover .vbar-tooltip,
.ytl-bar:hover .vbar-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Score color coding */
.vbar-col[data-score="1"] .vbar-fill,
.vbar-col[data-score="2"] .vbar-fill,
.vbar-col[data-score="3"] .vbar-fill { background: #ef4444; }
.vbar-col[data-score="4"] .vbar-fill,
.vbar-col[data-score="5"] .vbar-fill { background: #f59e0b; }
.vbar-col[data-score="6"] .vbar-fill,
.vbar-col[data-score="7"] .vbar-fill { background: #eab308; }
.vbar-col[data-score="8"] .vbar-fill,
.vbar-col[data-score="9"] .vbar-fill { background: #22c55e; }
.vbar-col[data-score="10"] .vbar-fill { background: #8b5cf6; }

/* Full Page Charts - Card Grid Layout */
/* Stats Card Grid - Cover-Focused Design */
.full-bar-chart {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--primary);
}

/* Hero Cover Section */
.stat-card-cover {
    position: relative;
    height: 140px;
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-deep) 100%);
    background-size: cover;
    background-position: center;
}

.stat-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.6) 40%,
        rgba(0, 0, 0, 0.2) 70%,
        transparent 100%
    );
}

.stat-card:hover .stat-card-cover::after {
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.15) 70%,
        transparent 100%
    );
}

/* Rank Badge */
.stat-card-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:nth-child(-n+3) .stat-card-rank {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.stat-card:nth-child(n+4):nth-child(-n+10) .stat-card-rank {
    background: rgba(var(--primary-rgb), 0.3);
    color: #c4b5fd;
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

/* Overlay Text */
.stat-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px;
    z-index: 2;
}

.stat-card-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.stat-card-hero-title {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Card Body */
.stat-card-body {
    padding: 12px 14px;
    background: var(--bg-surface);
}

/* Stats Pills */
.stat-card-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-pill {
    font-size: 0.65rem;
    padding: 4px 8px;
    background: var(--bg-hover);
    border-radius: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 3px;
}

.stat-pill .stat-num {
    font-weight: 700;
    color: var(--text-primary);
}

.stat-pill.score .stat-num {
    color: var(--primary);
}

/* Thumbnail Strip */
.stat-card-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    align-items: center;
}

.stat-card-thumbs img {
    width: 32px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.stat-card-thumbs img:hover {
    transform: scale(1.15);
    z-index: 2;
    position: relative;
}

.thumb-count {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 4px 8px;
    background: var(--bg-hover);
    border-radius: 6px;
}

/* Filtered state */
.stat-card.filtered-out {
    display: none;
}

/* Section Summary Row */
.section-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.25s ease;
}

.summary-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-subtle);
}

.summary-stat.highlight {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.summary-stat.highlight:hover {
    border-color: rgba(var(--primary-rgb), 0.6);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.2);
}

.summary-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.summary-stat.highlight .summary-value {
    color: var(--primary-light);
}

.summary-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Top Items Grid */
.top-items-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

.top-item-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.25s ease;
    overflow: hidden;
}

.top-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: var(--border-hover);
}

.top-item-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    background: var(--bg-hover);
    border-radius: 6px;
}

.top-item-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.top-item-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-item-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.top-item-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.top-item-stat.highlight-stat {
    background: var(--bg-hover);
    border-radius: 4px;
    padding: 3px 6px;
    margin: -3px -6px;
}

.top-item-stat.highlight-stat .top-item-stat-value {
    color: var(--text-primary);
    font-weight: 700;
}

/* === STAT DETAIL MODAL === */
.stat-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.stat-detail-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.stat-detail-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.85);
}

.stat-detail-content {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    background: var(--bg-surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.stat-detail-overlay.active .stat-detail-content {
    transform: scale(1) translateY(0);
}

.stat-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-detail-close svg {
    width: 20px;
    height: 20px;
    color: white;
}

.stat-detail-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.stat-detail-header {
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-deep) 100%);
    border-bottom: 1px solid var(--border);
}

.stat-detail-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.stat-detail-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.stat-detail-stats {
    display: flex;
    gap: 24px;
}

.stat-detail-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-detail-stat-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-detail-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px 32px;
}

.stat-detail-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-detail-sort select {
    padding: 8px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.stat-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.stat-detail-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-hover);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid transparent;
}

.stat-detail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--border);
}

.stat-detail-card-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.stat-detail-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stat-detail-card-score {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.stat-detail-card-info {
    padding: 12px;
}

.stat-detail-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stat-detail-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.stat-detail-card-meta .status-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}

@media (max-width: 768px) {
    .stat-detail-content {
        width: 95%;
        max-height: 75vh;
    }

    .stat-detail-header {
        padding: 20px 16px 16px;
    }

    .stat-detail-title {
        font-size: 1.5rem;
    }

    .stat-detail-body {
        padding: 16px 20px 24px;
    }

    .stat-detail-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .top-items-grid { grid-template-columns: repeat(3, 1fr); }
    .top-items-grid .top-item-card:nth-child(n+4) { display: none; }
}

@media (max-width: 768px) {
    .section-summary-row { grid-template-columns: repeat(2, 1fr); }
    .top-items-grid { grid-template-columns: repeat(2, 1fr); }
    .top-items-grid .top-item-card:nth-child(n+3) { display: none; }
}

/* Chart Filter Row */
.chart-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 28px 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.chart-filter-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chart-search {
    width: 200px;
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.chart-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.chart-search::placeholder {
    color: var(--text-muted);
}


/* Country Distribution */
.country-chart-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
}

.country-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
    cursor: default;
}

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

.country-flag {
    font-size: 1.1rem;
}

.country-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.country-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.country-pct {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* Episode Count Distribution */
.episode-count-chart {
    padding: 10px 0;
}

/* Responsive Stats Layout */
@media (max-width: 900px) {
    .stats-layout {
        grid-template-columns: 1fr;
    }

    .stats-sidebar {
        position: static;
    }

    .stats-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px;
    }

    .stats-nav-item {
        flex: 0 0 auto;
        padding: 10px 14px;
        text-align: center;
        white-space: nowrap;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        position: static;
    }

    .settings-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px;
    }

    .settings-nav-item {
        flex: 0 0 auto;
        padding: 10px 14px;
        text-align: center;
        white-space: nowrap;
    }

    .stats-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .chart-toggle-group {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .vertical-bar-chart {
        height: 150px;
        gap: 2px;
    }

    .vbar-fill-wrap {
        height: 100px;
    }

    .vbar-value {
        font-size: 0.6rem;
    }

    .vbar-label {
        font-size: 0.6rem;
    }

    .full-bar-chart {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .stat-card-cover {
        height: 110px;
    }

    .stat-card-name {
        font-size: 0.9rem;
    }

    .stat-card-body {
        padding: 10px 12px;
    }

    .stat-card-thumbs img {
        width: 26px;
        height: 36px;
    }

    .card-header-with-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ============================================
   MOBILE SETTINGS TAB STYLES
   ============================================ */

/* Tablet - 768px */
@media (max-width: 768px) {
    .settings-container {
        padding: 12px !important;
    }

    .settings-section {
        margin-bottom: 24px !important;
    }

    .settings-section-title {
        font-size: 0.75rem !important;
        padding: 0 8px !important;
        margin-bottom: 10px !important;
    }

    .settings-card {
        border-radius: 12px !important;
    }

    .setting-row {
        padding: 16px !important;
        margin-bottom: 10px !important;
        border-radius: 10px !important;
    }

    .setting-info h4 {
        font-size: 0.9rem !important;
    }

    .setting-info p {
        font-size: 0.75rem !important;
    }

    /* Toggle switches - make touch-friendly */
    .toggle-switch {
        width: 52px !important;
        height: 30px !important;
    }

    .toggle-slider::before {
        height: 22px !important;
        width: 22px !important;
        left: 3px !important;
        bottom: 3px !important;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px) !important;
    }

    /* Buttons - make touch-friendly */
    .btn-setting {
        padding: 12px 20px !important;
        font-size: 0.875rem !important;
        min-height: 44px !important;
        border-radius: 10px !important;
    }

    .btn-save-about {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Form inputs */
    .setting-input {
        padding: 12px 14px !important;
        font-size: 0.875rem !important;
        min-height: 44px !important;
    }

    .setting-control select {
        padding: 12px 40px 12px 14px !important;
        font-size: 0.875rem !important;
        min-height: 44px !important;
    }

    /* About editor */
    .about-editor-row {
        gap: 16px !important;
    }

    .about-toolbar {
        padding: 8px 6px !important;
    }

    .toolbar-btn {
        width: 32px !important;
        height: 32px !important;
        min-height: 44px !important;
        border-radius: 8px !important;
    }

    .toolbar-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    .about-editor .profile-about-input {
        min-height: 240px !important;
        padding: 14px !important;
        font-size: 0.875rem !important;
    }

    .about-preview {
        padding: 14px !important;
        font-size: 0.875rem !important;
    }

    .about-preview-label {
        padding: 10px 12px !important;
        font-size: 0.7rem !important;
    }

    /* Profile images */
    .profile-images-row {
        gap: 12px !important;
    }

    .image-upload-compact {
        min-height: 80px !important;
    }

    .image-upload-compact.image-upload-banner {
        min-width: 180px !important;
    }

    .upload-placeholder svg {
        width: 24px !important;
        height: 24px !important;
    }

    .upload-placeholder span {
        font-size: 0.65rem !important;
    }
}

/* Mobile - 600px */
@media (max-width: 600px) {
    .settings-container {
        padding: 8px !important;
        max-width: 100% !important;
    }

    .settings-section {
        margin-bottom: 20px !important;
    }

    .settings-section-title {
        font-size: 0.7rem !important;
        padding: 0 4px !important;
        margin-bottom: 8px !important;
    }

    .setting-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 16px 14px !important;
        margin-bottom: 8px !important;
    }

    .setting-row:hover {
        border-color: rgba(var(--primary-rgb), 0.3) !important;
    }

    .setting-info {
        width: 100% !important;
    }

    .setting-info h4 {
        font-size: 0.875rem !important;
        margin-bottom: 4px !important;
    }

    .setting-info p {
        font-size: 0.7rem !important;
        line-height: 1.5 !important;
    }

    .setting-control {
        width: 100% !important;
        flex-shrink: 1 !important;
    }

    .setting-control select {
        width: 100% !important;
        min-width: unset !important;
    }

    .setting-control-wide {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .setting-input {
        width: 100% !important;
        min-width: unset !important;
    }

    /* Toggle switches - full width row on mobile */
    .toggle-switch {
        width: 54px !important;
        height: 32px !important;
    }

    .toggle-slider::before {
        height: 24px !important;
        width: 24px !important;
        left: 3px !important;
        bottom: 3px !important;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px) !important;
    }

    /* Buttons - full width on mobile */
    .btn-setting {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 0.875rem !important;
        min-height: 48px !important;
        justify-content: center !important;
        border-radius: 12px !important;
    }

    /* About editor - stack vertically */
    .about-editor-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .about-editor {
        flex-direction: row !important;
        border-radius: 12px !important;
    }

    .about-toolbar {
        flex-direction: column !important;
        padding: 8px 6px !important;
        gap: 3px !important;
    }

    .toolbar-btn {
        width: 34px !important;
        height: 34px !important;
        min-height: 44px !important;
    }

    .toolbar-divider {
        margin: 6px 0 !important;
    }

    .about-editor .profile-about-input {
        min-height: 220px !important;
        padding: 12px !important;
        font-size: 0.85rem !important;
        line-height: 1.6 !important;
    }

    .about-preview-container {
        min-height: 150px !important;
        border-radius: 12px !important;
    }

    .about-preview {
        padding: 12px !important;
        font-size: 0.85rem !important;
        min-height: 120px !important;
    }

    .about-preview-label {
        padding: 8px 10px !important;
        font-size: 0.65rem !important;
    }

    /* Profile images - stack vertically */
    .profile-images-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .image-upload-compact {
        width: 100% !important;
        height: 100px !important;
        min-height: unset !important;
        border-radius: 12px !important;
    }

    .image-upload-compact.image-upload-banner {
        width: 100% !important;
        min-width: unset !important;
        height: 120px !important;
    }

    .upload-hint {
        font-size: 0.7rem !important;
        margin-top: 6px !important;
        line-height: 1.4 !important;
    }

    /* Danger settings */
    .setting-row.setting-danger {
        background: rgba(239, 68, 68, 0.05) !important;
        border: 1px solid rgba(239, 68, 68, 0.15) !important;
    }

    .setting-row.setting-danger:hover {
        background: rgba(239, 68, 68, 0.08) !important;
        border-color: rgba(239, 68, 68, 0.3) !important;
    }

    /* Username input */
    #usernameInput {
        width: 100% !important;
    }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
    .settings-container {
        padding: 4px !important;
    }

    .settings-section {
        margin-bottom: 16px !important;
    }

    .settings-section-title {
        font-size: 0.65rem !important;
        padding: 0 2px !important;
        margin-bottom: 6px !important;
        gap: 6px !important;
    }

    .settings-section-title svg {
        width: 14px !important;
        height: 14px !important;
    }

    .setting-row {
        padding: 14px 12px !important;
        margin-bottom: 6px !important;
        gap: 10px !important;
        border-radius: 10px !important;
    }

    .setting-info h4 {
        font-size: 0.85rem !important;
        margin-bottom: 3px !important;
    }

    .setting-info p {
        font-size: 0.68rem !important;
        line-height: 1.4 !important;
    }

    /* Toggle switches - larger for easier tapping */
    .toggle-switch {
        width: 56px !important;
        height: 34px !important;
    }

    .toggle-slider {
        border-radius: 34px !important;
    }

    .toggle-slider::before {
        height: 26px !important;
        width: 26px !important;
        left: 3px !important;
        bottom: 3px !important;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px) !important;
    }

    /* Buttons - larger tap targets */
    .btn-setting {
        padding: 16px 18px !important;
        font-size: 0.85rem !important;
        min-height: 50px !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
    }

    .btn-save-about {
        padding: 16px 20px !important;
        min-height: 52px !important;
        font-size: 0.9rem !important;
    }

    /* Form inputs - larger and more readable */
    .setting-input {
        padding: 14px 12px !important;
        font-size: 0.85rem !important;
        min-height: 50px !important;
        border-radius: 10px !important;
    }

    .setting-control select {
        padding: 14px 38px 14px 12px !important;
        font-size: 0.85rem !important;
        min-height: 50px !important;
        border-radius: 10px !important;
    }

    /* About editor - compact toolbar */
    .about-toolbar {
        padding: 6px 4px !important;
        gap: 2px !important;
    }

    .toolbar-btn {
        width: 32px !important;
        height: 32px !important;
        min-height: 40px !important;
        border-radius: 6px !important;
    }

    .toolbar-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .toolbar-divider {
        margin: 4px 0 !important;
    }

    .about-editor .profile-about-input {
        min-height: 200px !important;
        padding: 10px !important;
        font-size: 0.8rem !important;
    }

    .about-preview {
        padding: 10px !important;
        font-size: 0.8rem !important;
        min-height: 100px !important;
    }

    .about-preview-label {
        padding: 6px 8px !important;
        font-size: 0.6rem !important;
    }

    .about-content {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    .about-content h1 { font-size: 1.3rem !important; }
    .about-content h2 { font-size: 1.15rem !important; }
    .about-content h3 { font-size: 1rem !important; }

    /* Profile images - compact */
    .image-upload-compact {
        height: 90px !important;
        border-width: 2px !important;
    }

    .image-upload-compact.image-upload-banner {
        height: 100px !important;
    }

    .upload-placeholder {
        padding: 8px !important;
        gap: 4px !important;
    }

    .upload-placeholder svg {
        width: 22px !important;
        height: 22px !important;
    }

    .upload-placeholder span {
        font-size: 0.6rem !important;
    }

    .upload-hint {
        font-size: 0.65rem !important;
    }

    /* Password modal inputs */
    .password-requirements {
        padding: 10px !important;
        margin-top: 10px !important;
        border-radius: 8px !important;
    }

    .password-requirements p {
        font-size: 0.75rem !important;
    }

    /* Delete warning */
    .delete-warning {
        padding: 12px !important;
        margin-bottom: 16px !important;
        border-radius: 10px !important;
    }

    .delete-warning p {
        font-size: 0.85rem !important;
    }

    .delete-warning li {
        font-size: 0.75rem !important;
    }
}

/* ============================================
   MOBILE MODAL STYLES
   ============================================ */

@media (max-width: 768px) {
    /* Compact centered modal with slide animation */
    .modal-overlay:not(#addListModal):not(#editListModal) {
        padding: 20px;
        align-items: center;
        justify-content: center;
    }

    .modal:not(.add-list-modal):not(.shared-modal) {
        max-width: 300px;
        max-height: 75vh;
        border-radius: 12px;
        margin: 0;
        overflow-y: auto;
        transform: scale(0.95) translateY(20px);
        transition: transform 0.25s ease;
    }

    .modal-overlay.open .modal:not(.add-list-modal):not(.shared-modal) {
        transform: scale(1) translateY(0);
    }

    .modal-header:not(.shared-modal .modal-header) {
        padding: 10px 12px;
        position: sticky;
        top: 0;
        background: var(--bg-surface);
        z-index: 10;
    }

    .modal-header:not(.shared-modal .modal-header) h3 {
        font-size: 0.85rem;
    }

    .modal-close:not(.shared-modal .modal-close) {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    .modal-close:not(.shared-modal .modal-close) svg {
        width: 16px;
        height: 16px;
    }

    .modal-body:not(.shared-modal .modal-body) {
        padding: 10px 12px;
        overflow-y: auto;
    }

    .modal-anime-info {
        gap: 8px;
        margin-bottom: 10px;
    }

    .modal-anime-info img {
        width: 40px;
        height: 56px;
    }

    .modal-anime-info h4 {
        font-size: 0.8rem;
    }

    .modal-anime-info p {
        font-size: 0.7rem;
    }

    .form-group {
        margin-bottom: 8px;
    }

    .form-group label {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    /* Form inputs - compact but still 16px to prevent iOS zoom */
    .form-group select,
    .form-group textarea,
    .form-group input[type="text"],
    .form-group input[type="number"] {
        font-size: 16px;
        min-height: 36px;
        padding: 6px 10px;
    }

    .form-group select {
        -webkit-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 14px;
        padding-right: 32px;
    }

    /* Progress input - compact */
    .progress-input {
        gap: 6px;
    }

    .progress-btn {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .progress-input input[type="number"] {
        width: 50px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* Rewatch input */
    .rewatch-input input[type="number"] {
        width: 50px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* Score input */
    .score-input input[type="range"] {
        height: 5px;
    }

    .score-input input[type="range"]::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    .score-input input[type="range"]::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }

    .score-display {
        font-size: 0.95rem;
        min-width: 28px;
    }

    /* Modal footer buttons */
    .modal-footer:not(.shared-modal .modal-footer) {
        padding: 10px 12px;
        gap: 6px;
        position: sticky;
        bottom: 0;
        background: var(--bg-surface);
        border-top: 1px solid var(--border);
    }

    .btn-delete,
    .btn-save {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .btn-save {
        flex: 1;
    }

    /* Confirm modal */
    .confirm-modal .modal-body {
        padding: 14px 12px;
    }

    .confirm-modal .modal-footer {
        flex-direction: column;
        gap: 6px;
    }

    .confirm-modal .modal-footer button {
        width: 100%;
        min-height: 36px;
    }
}

@media (max-width: 600px) {
    .modal:not(.add-list-modal):not(.shared-modal) {
        max-width: 280px;
        max-height: 72vh;
    }

    .modal-header:not(.shared-modal .modal-header) {
        padding: 8px 10px;
    }

    .modal-body:not(.shared-modal .modal-body) {
        padding: 8px 10px;
    }

    .modal-footer:not(.shared-modal .modal-footer) {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .modal-header:not(.shared-modal .modal-header) h3 {
        font-size: 0.8rem;
    }

    .modal-anime-info img {
        width: 36px;
        height: 50px;
    }

    .modal-anime-info h4 {
        font-size: 0.75rem;
    }

    .modal-anime-info p {
        font-size: 0.65rem;
    }

    .form-group label {
        font-size: 0.75rem;
    }

    .modal-footer:not(.shared-modal .modal-footer) {
        padding: 14px 16px;
    }
}

/* ============================================
   ANIME LIST TAB - MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet/Mobile - 768px */
@media (max-width: 768px) {
    /* List Type Switcher - Stack buttons */
    .list-type-switcher {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .list-type-btn {
        flex: 1 1 auto !important;
        min-width: 140px !important;
        justify-content: center !important;
    }

    .list-search {
        order: 3 !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    .btn-create-list-inline {
        order: 4 !important;
        width: 100% !important;
    }

    /* Status Filter Row - Stack elements */
    .status-filter-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    /* Status Tabs - Horizontal scroll */
    .status-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        padding-bottom: 4px !important;
    }

    .status-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .status-tab {
        flex-shrink: 0 !important;
        min-width: fit-content !important;
    }

    /* List Controls Bar - Wrap controls */
    .list-controls-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .list-actions {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .list-sort {
        flex: 1 !important;
        min-width: 140px !important;
    }

    .list-sort select {
        width: 100% !important;
    }

    /* List View Toggle - Touch friendly */
    .list-view-toggle {
        min-height: 40px !important;
    }

    .view-btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* View Mode Toggle - Touch friendly */
    .list-view-mode {
        min-height: 40px !important;
    }

    .view-mode-btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* More Menu - Touch friendly */
    .more-menu-btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .more-menu-dropdown {
        min-width: 200px !important;
        right: 0 !important;
        left: auto !important;
    }

    .more-menu-item {
        padding: 12px 16px !important;
        font-size: 0.85rem !important;
        min-height: 44px !important;
    }

    /* List Items - Maintain desktop layout on tablet */
    .list-item {
        grid-template-columns: 75px 1fr auto !important;
        gap: 12px !important;
        padding: 14px !important;
    }

    .item-cover {
        width: 75px !important;
        height: 105px !important;
    }

    /* Action buttons - Touch friendly */
    .btn-increment,
    .btn-edit {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .btn-increment svg,
    .btn-edit svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Mobile - 600px */
@media (max-width: 600px) {
    /* List Type Switcher - Full width buttons */
    .list-type-btn {
        min-width: auto !important;
        font-size: 0.8rem !important;
        padding: 10px 12px !important;
    }

    .list-type-count {
        font-size: 0.7rem !important;
    }

    /* Status Tabs - More compact */
    .status-tab {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
    }

    .tab-count {
        padding: 2px 6px !important;
        font-size: 0.65rem !important;
    }

    /* List Controls - Stack vertically */
    .list-actions {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .list-sort {
        width: 100% !important;
        order: 1 !important;
    }

    .list-view-toggle {
        order: 2 !important;
    }

    .list-view-mode {
        order: 3 !important;
    }

    .list-more-menu {
        order: 4 !important;
        margin-left: auto !important;
    }

    /* List Items - Compact two-column layout */
    .list-item {
        grid-template-columns: 65px 1fr !important;
        gap: 10px !important;
        padding: 12px !important;
        position: relative !important;
    }

    .item-cover {
        width: 65px !important;
        height: 91px !important;
    }

    /* Item Info - Adjust spacing */
    .item-info {
        gap: 4px !important;
    }

    .item-header {
        gap: 6px !important;
    }

    .item-title {
        font-size: 0.9rem !important;
    }

    .item-format {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }

    .item-meta-row {
        font-size: 0.75rem !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .item-meta-row .status-badge {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }

    /* Item Stats - Horizontal compact layout */
    .item-stats {
        gap: 12px !important;
        margin-top: 2px !important;
    }

    .item-stat-value {
        font-size: 0.85rem !important;
    }

    .item-stat-label {
        font-size: 0.6rem !important;
    }

    /* Progress Bar - Thinner */
    .item-progress-bar {
        height: 4px !important;
        margin-top: 6px !important;
    }

    /* Notes - Smaller text */
    .item-notes {
        font-size: 0.75rem !important;
        margin-top: 6px !important;
    }

    .item-notes svg {
        width: 12px !important;
        height: 12px !important;
    }

    /* Actions - Position in top-right corner */
    .item-actions {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        flex-direction: row !important;
        gap: 6px !important;
    }

    .btn-increment,
    .btn-edit {
        width: 40px !important;
        height: 40px !important;
        border-radius: 8px !important;
    }

    .btn-increment svg,
    .btn-edit svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Bulk Action Bar - Mobile optimized */
    .bulk-action-bar {
        flex-wrap: wrap !important;
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .bulk-info {
        width: 100% !important;
        justify-content: space-between !important;
        margin-bottom: 4px !important;
    }

    .bulk-actions {
        flex: 1 !important;
        gap: 6px !important;
    }

    .bulk-btn {
        flex: 1 !important;
        font-size: 0.75rem !important;
        padding: 8px 10px !important;
        min-height: 40px !important;
    }

    .bulk-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .btn-select-all,
    .btn-deselect-all {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
    /* Main padding reduction */
    .profile-main {
        padding: 16px 12px 60px !important;
    }

    /* List Type Switcher - Very compact */
    .list-type-switcher {
        gap: 6px !important;
    }

    .list-type-btn {
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
    }

    .list-type-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Status Tabs - Smaller */
    .status-tab {
        padding: 6px 10px !important;
        font-size: 0.7rem !important;
    }

    .tab-count {
        padding: 1px 5px !important;
        font-size: 0.6rem !important;
    }

    /* List Controls - Very compact */
    .list-controls-bar {
        margin-bottom: 8px !important;
    }

    .list-sort select {
        font-size: 0.75rem !important;
        padding: 8px 24px 8px 10px !important;
    }

    /* List Items - Ultra compact */
    .list-item {
        grid-template-columns: 55px 1fr !important;
        gap: 8px !important;
        padding: 10px !important;
        border-radius: 12px !important;
    }

    .item-cover {
        width: 55px !important;
        height: 77px !important;
        border-radius: 8px !important;
    }

    /* Item Info - Very compact */
    .item-info {
        gap: 3px !important;
    }

    .item-header {
        gap: 4px !important;
    }

    .item-title {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }

    .item-format {
        font-size: 0.55rem !important;
        padding: 2px 5px !important;
    }

    .item-meta-row {
        font-size: 0.7rem !important;
        gap: 6px !important;
    }

    .item-meta-row .status-badge {
        font-size: 0.55rem !important;
        padding: 2px 5px !important;
    }

    /* Item Stats - Very compact */
    .item-stats {
        gap: 10px !important;
        margin-top: 2px !important;
    }

    .item-stat-value {
        font-size: 0.8rem !important;
    }

    .item-stat-label {
        font-size: 0.55rem !important;
    }

    /* Progress Bar - Very thin */
    .item-progress-bar {
        height: 3px !important;
        margin-top: 4px !important;
    }

    /* Notes - Very compact */
    .item-notes {
        font-size: 0.7rem !important;
        margin-top: 4px !important;
    }

    .item-notes svg {
        width: 11px !important;
        height: 11px !important;
    }

    /* Actions - Smaller buttons */
    .item-actions {
        top: 6px !important;
        right: 6px !important;
        gap: 4px !important;
    }

    .btn-increment,
    .btn-edit {
        width: 36px !important;
        height: 36px !important;
        border-radius: 6px !important;
    }

    .btn-increment svg,
    .btn-edit svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* More Menu Dropdown - Full width on very small screens */
    .more-menu-dropdown {
        min-width: 180px !important;
    }

    .more-menu-item {
        padding: 10px 14px !important;
        font-size: 0.8rem !important;
    }

    .more-menu-item svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Bulk Action Bar - Very compact */
    .bulk-action-bar {
        padding: 8px 10px !important;
        gap: 6px !important;
    }

    .bulk-info {
        font-size: 0.75rem !important;
    }

    .bulk-btn {
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
        min-height: 36px !important;
    }

    .bulk-btn svg {
        width: 14px !important;
        height: 14px !important;
        margin-right: 4px !important;
    }

    .btn-select-all,
    .btn-deselect-all {
        font-size: 0.7rem !important;
        padding: 3px 6px !important;
    }

    .bulk-close {
        min-width: 36px !important;
        min-height: 36px !important;
    }

    .bulk-close svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Search Input - Full width */
    .list-search-input {
        font-size: 0.75rem !important;
        padding: 8px 8px 8px 28px !important;
    }

    .list-search svg {
        width: 12px !important;
        height: 12px !important;
        left: 8px !important;
    }
}

/* =============================================
   CONTRIBUTOR BADGES PANEL
   ============================================= */

.contributor-badges-panel {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.02));
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.contributor-badges-panel .panel-title {
    color: var(--accent-primary) !important;
}

.contributor-badges-panel .panel-title::before {
    content: '✨';
    margin-right: 8px;
}

.contributor-stats-mini {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.contrib-stat-mini {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contrib-stat-mini strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.profile-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.profile-badge:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.profile-badge-icon {
    font-size: 1.1rem;
}

.profile-badge-name {
    color: var(--text-primary);
    font-weight: 500;
}

.profile-badge.special {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(234, 179, 8, 0.05));
    border-color: rgba(234, 179, 8, 0.3);
}

.profile-badge.special .profile-badge-name {
    color: #eab308;
}

.profile-badges-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 16px;
}

@media (max-width: 600px) {
    .contributor-stats-mini {
        flex-direction: column;
        gap: 8px;
    }

    .profile-badges-grid {
        justify-content: center;
    }
}

/* ============================================
   ANALYTICS SUITE (Super Supporter+)
   ============================================ */

/* ── Analytics Nav Button ── */
.stats-nav-analytics {
    display: none;
    position: relative;
    align-items: center;
    gap: 6px;
}

.stats-nav-analytics.visible {
    display: flex;
}

.analytics-badge {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(var(--primary-rgb), 0.2));
    color: #f472b6;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(244, 114, 182, 0.3);
}

/* ── Analytics Loading ── */
.analytics-loading {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 48px 0;
}

.analytics-loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.analytics-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--primary-rgb), 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: analyticsSpinner 0.8s linear infinite;
}

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

.analytics-loading-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    font-family: var(--font-display);
}

.analytics-loading-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* Skeleton cards */
.analytics-skeleton {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-row {
    display: grid;
    gap: 20px;
}

.skeleton-row:nth-child(2) { grid-template-columns: 1fr 1fr; }
.skeleton-row:nth-child(3) { grid-template-columns: 1fr 1fr 1fr; }

.skeleton-card {
    height: 180px;
    border-radius: 16px;
    background: linear-gradient(110deg, rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 70%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border: 1px solid rgba(255,255,255,0.04);
}

.skeleton-card.skeleton-wide {
    height: 120px;
}

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

@media (max-width: 768px) {
    .skeleton-row:nth-child(2),
    .skeleton-row:nth-child(3) { grid-template-columns: 1fr; }
    .skeleton-card { height: 120px; }
}

/* ══════════════════════════════════════════════
   LAYOUT SYSTEM
   ══════════════════════════════════════════════ */

.analytics-hub {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.analytics-chapter {
    display: flex;
    flex-direction: column;
}

/* ── Row Grid ── */
.analytics-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.analytics-row:last-child {
    margin-bottom: 0;
}

.analytics-row.cols-1 { grid-template-columns: 1fr; }
.analytics-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.analytics-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ══════════════════════════════════════════════
   CHAPTER HEADERS
   ══════════════════════════════════════════════ */

.analytics-chapter-header {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.1);
}

.analytics-chapter-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(var(--primary-rgb), 0.15);
    font-family: var(--font-display);
    line-height: 1;
    flex-shrink: 0;
}

.analytics-chapter-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-display);
    margin: 0;
    line-height: 1.2;
}

.analytics-chapter-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 3px 0 0;
    line-height: 1.4;
}

/* ══════════════════════════════════════════════
   ANALYTICS CARD
   ══════════════════════════════════════════════ */

.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    overflow: hidden;
    min-width: 0;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.analytics-card:hover {
    border-color: rgba(var(--primary-rgb), 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(var(--primary-rgb), 0.06);
}

/* ── Card Header ── */
.analytics-card-header {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.analytics-card-titles {
    flex: 1;
    min-width: 0;
}

.analytics-card-titles h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.analytics-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}

/* ── Card Hero Value ── */
.analytics-card-hero {
    margin-left: auto;
    text-align: right;
    flex-shrink: 0;
}

.analytics-card-hero .hero-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.analytics-card-hero .hero-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 2px;
}

/* ── Card Narrative ── */
.analytics-card-narrative {
    background: rgba(var(--primary-rgb), 0.04);
    border-left: 3px solid rgba(var(--primary-rgb), 0.3);
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.analytics-card-narrative p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.analytics-card-narrative:empty {
    display: none;
}

/* ══════════════════════════════════════════════
   OVERVIEW CARD
   ══════════════════════════════════════════════ */

.analytics-overview {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06) 0%, transparent 60%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 40px;
    overflow: hidden;
}

.overview-archetype {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}


.archetype-text {
    flex: 1;
    min-width: 0;
}

.archetype-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

.archetype-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 4px 0;
    line-height: 1.2;
}

.archetype-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.overview-stat {
    text-align: center;
}

.overview-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.overview-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
    display: block;
}

/* ══════════════════════════════════════════════
   3-COL CARD OVERRIDES
   ══════════════════════════════════════════════ */

.cols-3 .analytics-card {
    padding: 20px 22px;
}

.cols-3 .analytics-card-titles h3 {
    font-size: 0.85rem;
}

.cols-3 .analytics-card-desc {
    font-size: 0.7rem;
}

.cols-3 .analytics-card-hero .hero-value {
    font-size: 1.2rem;
}

.cols-3 .analytics-card-narrative {
    font-size: 0.78rem;
    padding: 10px 14px;
}

.cols-3 .discovery-metrics {
    grid-template-columns: repeat(2, 1fr);
}

/* ══════════════════════════════════════════════
   APEXCHARTS THEME OVERRIDES
   ══════════════════════════════════════════════ */

.apexcharts-tooltip {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
}

.apexcharts-tooltip-title {
    background: var(--bg-surface) !important;
    border-bottom-color: var(--border) !important;
    color: var(--text-primary) !important;
}

.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
    background: var(--bg-elevated) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

.apexcharts-legend-text {
    color: var(--text-secondary) !important;
}

.apexcharts-gridline {
    stroke: var(--border) !important;
}

.apexcharts-text {
    fill: var(--text-muted) !important;
}

/* ══════════════════════════════════════════════
   SUB-COMPONENTS
   ══════════════════════════════════════════════ */

/* ── Taste DNA Grid ── */
.dna-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dna-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dna-card:hover {
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.06);
}

.dna-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
}

.dna-card-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 12px;
}

.dna-card.dna-radar {
    grid-column: span 2;
}

.dna-dimension {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dna-dimension-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 80px;
    flex-shrink: 0;
    text-align: right;
}

.dna-dimension-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.dna-dimension-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.dna-dimension-value {
    font-size: 0.7rem;
    color: var(--text-secondary);
    width: 30px;
    text-align: left;
}

.dna-affinity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.dna-affinity:last-child {
    border-bottom: none;
}

.dna-affinity-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dna-affinity-score {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

/* ── DNA Stats ── */
.dna-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dna-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 70px;
}

.dna-stat-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: capitalize;
}

.dna-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Tone Bars (Taste DNA) ── */
.tone-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tone-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tone-label-left, .tone-label-right {
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 70px;
}

.tone-label-left { text-align: right; }
.tone-label-right { text-align: left; }

.tone-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    position: relative;
}

.tone-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, var(--primary));
    border-radius: 3px;
}

.tone-bar-marker {
    position: absolute;
    top: -3px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.5);
}

/* ── Affinity List ── */
.affinity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.affinity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: default;
}

.affinity-item:hover {
    background: rgba(var(--primary-rgb), 0.06);
    transform: translateX(4px);
}

.affinity-item:hover .affinity-name {
    color: var(--text-primary);
}

.affinity-item:hover .affinity-bar-fill {
    filter: brightness(1.2);
}

.affinity-item:hover .affinity-score {
    color: var(--primary);
}

.affinity-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.affinity-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.affinity-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.6s ease, filter 0.2s ease;
}

.affinity-score {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 38px;
    text-align: right;
    transition: color 0.2s ease;
}

/* ── Discovery Metrics ── */
.discovery-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.discovery-metric {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}

.discovery-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discovery-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Discovery Score (circle) ── */
.discovery-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.discovery-score-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.discovery-ring {
    width: 100%;
    height: 100%;
}

.discovery-score-val {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--score-color, var(--primary));
}

.discovery-score-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.discovery-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.discovery-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.disc-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.disc-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Taste Evolution Grid ── */
.taste-evo-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
}

.taste-evo-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.taste-evo-column h4 {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0;
}

.taste-evo-column .analytics-stat-row {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.taste-evo-column .analytics-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 18px;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 10px;
}

.taste-evo-column .stat-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.taste-evo-column .stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.taste-evo-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.5rem;
    flex-shrink: 0;
    opacity: 0.5;
}

.taste-evo-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    color: var(--text-secondary);
    white-space: nowrap;
    margin: 2px 3px;
    transition: transform 0.15s ease;
}

.taste-evo-tag:hover {
    transform: translateY(-1px);
}

.taste-evo-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.taste-evo-summary {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.5;
}

.taste-evo-tag.gained {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.taste-evo-tag.lost {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ── Franchise List ── */
.franchise-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.franchise-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.franchise-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.franchise-bar {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.franchise-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
}

.franchise-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Score Correlation Grid ── */
.correlation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.correlation-column h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.correlation-column.positive h4 { color: #10b981; }
.correlation-column.negative h4 { color: #ef4444; }

.correlation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}

.correlation-attr {
    color: var(--text-secondary);
}

.correlation-score {
    font-weight: 600;
    font-size: 0.8rem;
}

.correlation-score.high { color: #10b981; }
.correlation-score.low { color: #ef4444; }

/* ── Personality Card ── */
.personality-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    margin-bottom: 12px;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 12px;
}

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

.personality-type-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.personality-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.personality-stats {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.personality-stats .analytics-stat-item {
    min-width: 64px;
}

/* ── Anime Item Lists (Controversial / Gems / Outliers) ── */
.analytics-anime-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analytics-anime-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    gap: 12px;
}

.analytics-anime-item .anime-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.analytics-anime-item .anime-scores {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.anime-score-chip {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.anime-score-chip.user-score {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
}

.anime-score-chip.community-score {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.anime-score-chip.diff-positive {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.anime-score-chip.diff-negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ── Genre Breaker Explanations ── */
.genre-breaker-item {
    flex-direction: column;
    align-items: stretch;
}

.genre-breaker-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.genre-breaker-top .anime-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.genre-breaker-explanation {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ── Coming Soon Placeholder ── */
.analytics-coming-soon {
    opacity: 0.6;
}

.coming-soon-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    gap: 10px;
    color: var(--text-muted);
}

.coming-soon-placeholder svg {
    opacity: 0.4;
}

.coming-soon-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.coming-soon-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Percentile Insufficient Users ── */
.percentile-insufficient {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    gap: 10px;
    color: var(--text-muted);
}

.percentile-insufficient svg {
    opacity: 0.4;
}

.percentile-insufficient-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.percentile-insufficient-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 400px;
    line-height: 1.5;
}

/* ── Controversial Sections ── */
.controversial-lists {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.controversial-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* ── Speed Summary ── */
.speed-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.speed-stat {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.speed-stat strong {
    color: var(--primary);
    font-size: 1rem;
    margin-right: 4px;
}

/* ── Heatmap Stats (removed) ── */
}

.heatmap-stat strong {
    color: var(--text-primary);
    margin-right: 4px;
}

/* ── Shared Stat Rows ── */
.analytics-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.analytics-stat-item {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.analytics-stat-item .stat-val {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.analytics-stat-item .stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 3px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Sequel / Binge / Freshness / Loyalty / Attention / Streak / Niche Stats ── */
.sequel-stats, .binge-stats, .freshness-stats, .loyalty-stats, .attention-stats, .streak-stats, .niche-stats {
    margin-bottom: 14px;
}

/* ── Niche Stat Grid ── */
.niche-stat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.niche-stat-grid .analytics-stat-item {
    flex: 1;
    min-width: 60px;
    text-align: center;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.niche-stat-grid .stat-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.niche-stat-grid .stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    display: block;
}

/* ── Score Deviation Summary ── */
#deviationSummary {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.deviation-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
}

.deviation-value {
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
}

.deviation-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Drop Pattern Bars ── */
.drop-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    justify-content: center;
}

.drop-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.drop-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ef4444;
}

.drop-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.drop-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.drop-bars h4 {
    margin: 12px 0 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.drop-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drop-bar-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    min-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drop-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.drop-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f87171);
    border-radius: 3px;
}

.drop-bar-fill.rewatch-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.drop-bar-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 25px;
    text-align: right;
}

.drop-chart .drop-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.drop-row .drop-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 120px;
    flex-shrink: 0;
}

.drop-row .drop-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.drop-row .drop-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--error), #fb923c);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.drop-row .drop-rate {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 40px;
    text-align: right;
}

/* ── Rewatch Analytics ── */
.rewatch-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    justify-content: center;
}

.rewatch-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rewatch-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.rewatch-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rewatch-ranking {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.rewatch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.rewatch-rank {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 28px;
}

.rewatch-title {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rewatch-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.rewatch-list .rewatch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

/* ── Milestone Timeline ── */
.milestone-timeline {
    position: relative;
    padding-left: 24px;
}

.milestone-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.milestone-item {
    position: relative;
    padding: 8px 0 16px 16px;
}

.milestone-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-deep);
}

.milestone-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.milestone-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Timeline Track ── */
.timeline-track {
    position: relative;
    padding: 10px 0;
}

.timeline-track::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    display: flex;
    margin-bottom: 20px;
    width: 100%;
}

.timeline-left { justify-content: flex-end; padding-right: calc(50% + 20px); }
.timeline-right { justify-content: flex-start; padding-left: calc(50% + 20px); }

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid var(--bg-deep);
    z-index: 1;
}

.dot-anime { background: var(--primary); }
.dot-episode { background: #ec4899; }

.timeline-content {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px 14px;
    max-width: 220px;
}

.timeline-icon {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.timeline-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.timeline-anime {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.timeline-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Percentile Rows ── */
.percentile-intro {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
}

/* Percentile Rankings — Card Grid */
.percentile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.percentile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.percentile-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.percentile-rank {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.percentile-card .percentile-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.percentile-card .percentile-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.percentile-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.percentile-count {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
}

/* Tier colors */
.percentile-elite .percentile-rank { color: #10b981; }
.percentile-elite .percentile-bar-fill { background: #10b981; }
.percentile-elite { border-color: rgba(16, 185, 129, 0.2); }

.percentile-high .percentile-rank { color: #8b5cf6; }
.percentile-high .percentile-bar-fill { background: #8b5cf6; }
.percentile-high { border-color: rgba(139, 92, 246, 0.15); }

.percentile-mid .percentile-rank { color: #3b82f6; }
.percentile-mid .percentile-bar-fill { background: #3b82f6; }

.percentile-low .percentile-rank { color: #f59e0b; }
.percentile-low .percentile-bar-fill { background: #f59e0b; }

/* Genre Rankings */
.percentile-genre-section {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.percentile-genre-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.percentile-genre-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.percentile-genre-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.percentile-genre-name {
    width: 100px;
    font-size: 0.82rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.percentile-genre-row .percentile-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.percentile-genre-row .percentile-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.percentile-genre-rank {
    font-size: 0.78rem;
    font-weight: 600;
    width: 65px;
    text-align: right;
    flex-shrink: 0;
}

.percentile-genre-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    width: 65px;
    text-align: right;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .percentile-grid {
        grid-template-columns: 1fr;
    }
    .percentile-genre-name {
        width: 80px;
    }
    .percentile-genre-count {
        display: none;
    }
}

/* ── Analytics Section Headers (legacy) ── */
.analytics-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 16px 0 8px;
}

/* ══════════════════════════════════════════════
   PROMOTED WIDE — cards expanded from 2/3-col to full width
   ══════════════════════════════════════════════ */

.promoted-wide .analytics-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

/* Charts inside promoted cards get a constrained width so stats sit beside them */
.promoted-wide .analytics-card-body > [id$="ChartApex"],
.promoted-wide .analytics-card-body > [id$="chartApex"] {
    flex: 1 1 55%;
    min-width: 280px;
}

/* Stat blocks sit beside the chart */
.promoted-wide .analytics-card-body > .analytics-stat-row,
.promoted-wide .analytics-card-body > .niche-stat-grid,
.promoted-wide .analytics-card-body > .binge-stats,
.promoted-wide .analytics-card-body > .streak-stats,
.promoted-wide .analytics-card-body > .freshness-stats,
.promoted-wide .analytics-card-body > .niche-stats,
.promoted-wide .analytics-card-body > .speed-summary,
.promoted-wide .analytics-card-body > .rewatch-summary,
.promoted-wide .analytics-card-body > .drop-summary,
.promoted-wide .analytics-card-body > .sequel-stats,
.promoted-wide .analytics-card-body > .attention-stats,
.promoted-wide .analytics-card-body > .loyalty-stats,
.promoted-wide .analytics-card-body > [id$="Stats"],
.promoted-wide .analytics-card-body > [id$="Summary"],
.promoted-wide .analytics-card-body > [id$="summary"] {
    flex: 1 1 35%;
    min-width: 180px;
}

/* Stat rows in promoted cards spread wider */
.promoted-wide .analytics-stat-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
}

/* Lists in promoted cards use 2-column layout */
.promoted-wide .analytics-anime-list,
.promoted-wide .controversial-lists,
.promoted-wide .franchise-list,
.promoted-wide .affinity-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Controversial sub-sections span full width */
.promoted-wide .controversial-lists .controversial-section {
    grid-column: 1 / -1;
}

.promoted-wide .controversial-lists .controversial-section .analytics-anime-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Correlation grid gets more columns when wide */
.promoted-wide .correlation-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Rewatch ranking fills width */
.promoted-wide .rewatch-ranking {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Drop bars spread wider */
.promoted-wide .drop-bars {
    max-width: none;
}

.promoted-wide .drop-bar-label {
    min-width: 120px;
}

/* Discovery metrics get more columns */
.promoted-wide .discovery-metrics {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

/* Niche stat grid spreads out */
.promoted-wide .niche-stat-grid {
    gap: 12px;
}

.promoted-wide .niche-stat-grid .analytics-stat-item {
    min-width: 80px;
    padding: 10px 8px;
}

/* Speed stats spread horizontally */
.promoted-wide .speed-summary {
    justify-content: flex-start;
    gap: 20px;
}

/* Rewatch summary spreads */
.promoted-wide .rewatch-summary {
    justify-content: flex-start;
    gap: 24px;
}

/* Rewatch list and ranking span full width when promoted */
.promoted-wide #rewatchList,
.promoted-wide .rewatch-ranking {
    flex: 1 1 100%;
}

/* Rewatch summary sits beside chart */
.promoted-wide #rewatchSummary {
    flex: 0 0 auto;
    min-width: 140px;
}

.promoted-wide #rewatchChartApex {
    flex: 1 1 50%;
    min-width: 250px;
}

/* If the card body has only a chart (no stats sibling), let it fill */
.promoted-wide .analytics-card-body > [id$="ChartApex"]:only-child,
.promoted-wide .analytics-card-body > [id$="chartApex"]:only-child {
    flex: 1 1 100%;
    min-width: 0;
}

/* If there's only a list or non-chart content, let it fill */
.promoted-wide .analytics-card-body > .analytics-anime-list:only-child,
.promoted-wide .analytics-card-body > .controversial-lists:only-child,
.promoted-wide .analytics-card-body > .franchise-list:only-child,
.promoted-wide .analytics-card-body > .affinity-list:only-child,
.promoted-wide .analytics-card-body > [id$="Lists"]:only-child,
.promoted-wide .analytics-card-body > [id$="lists"]:only-child {
    flex: 1 1 100%;
}

/* Percentile bars use 2-column in promoted */
.promoted-wide .percentile-bars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
}

/* Genre percentile title spans full width */
.promoted-wide .genre-percentile-title {
    grid-column: 1 / -1;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .overview-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .analytics-row.cols-2 { grid-template-columns: 1fr; }
    .analytics-row.cols-3 { grid-template-columns: 1fr; }

    .analytics-chapter-number {
        font-size: 1.8rem;
    }

    .analytics-chapter-header h2 {
        font-size: 1.1rem;
    }

    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .overview-archetype {
        flex-direction: column;
        text-align: center;
    }

    .archetype-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .dna-grid {
        grid-template-columns: 1fr;
    }

    .dna-card.dna-radar {
        grid-column: span 1;
    }

    .discovery-metrics {
        grid-template-columns: 1fr;
    }

    .score-deviation-summary,
    .drop-summary,
    .rewatch-summary {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .timeline-track::before { left: 16px; }
    .timeline-left, .timeline-right {
        justify-content: flex-start;
        padding-left: 36px;
        padding-right: 0;
    }
    .timeline-dot { left: 16px; }

    .tone-label-left, .tone-label-right { min-width: 55px; font-size: 0.65rem; }
    .affinity-name { min-width: 75px; }
    .drop-bar-label { min-width: 70px; }
}

@media (max-width: 600px) {
    .analytics-row.cols-2,
    .analytics-row.cols-3 {
        grid-template-columns: 1fr;
    }

    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-card {
        padding: 20px 18px;
    }

    .analytics-overview {
        padding: 24px 20px;
    }

    .analytics-chapter-header {
        gap: 14px;
        margin-bottom: 24px;
    }

    .analytics-chapter-number {
        font-size: 1.5rem;
    }

    .speed-summary, .heatmap-stats { flex-wrap: wrap; }
    .analytics-stat-row { grid-template-columns: repeat(2, 1fr); }
    .taste-evo-grid { grid-template-columns: 1fr; }
    .taste-evo-arrow { transform: rotate(90deg); padding: 0; }
    .correlation-grid { grid-template-columns: 1fr; }
    .discovery-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ===== CUSTOM LIST COVERS ===== */
.list-cover {
    position: relative;
    height: 120px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.list-cover .list-cover-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.list-cover:hover .list-cover-btn {
    opacity: 1;
}

.list-cover-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.list-cover-btn svg {
    width: 16px;
    height: 16px;
}

.list-cover-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.custom-list-card:has(.list-cover) .list-card-header {
    border-radius: 0 0 12px 12px;
}

/* ===== COMPATIBILITY PANEL ===== */
.compatibility-panel {
    margin-top: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.compatibility-panel .panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.compatibility-panel .panel-title svg {
    width: 20px;
    height: 20px;
    color: #e91e63;
}

.compat-display {
    display: flex;
    align-items: center;
    gap: 24px;
}

.compat-circle-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.compat-circle {
    width: 100%;
    height: 100%;
}

.compat-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
}

.compat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compat-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.compat-shared {
    font-size: 0.85rem;
    color: var(--text-muted);
}
}

/* ===== Gift Code Redeem ===== */
.gift-code-input {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    max-width: 200px;
}

.gift-grant-active {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
}

/* ===== Settings Group Divider ===== */
.settings-group-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 8px 0 4px;
}

/* ===== Settings Sidebar Layout ===== */
.settings-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
}

.settings-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 74px;
    align-self: start;
    z-index: 10;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
}

.settings-nav-item {
    padding: 12px 14px;
    background: none;
    border: none;
    border-radius: 8px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 600;
}

.settings-content {
    min-width: 0;
}

.settings-page {
    display: none;
    animation: settingsFadeIn 0.2s ease;
}

.settings-page.active {
    display: block;
}

@keyframes settingsFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Referrals Section ===== */
.ref-link-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.ref-link-display {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ref-progress-tier {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-surface);
    border-radius: 12px;
    margin-bottom: 8px;
}
.ref-progress-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}
.ref-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.ref-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.ref-progress-fill--supporter { background: #a78bfa; }
.ref-progress-fill--super_supporter { background: #f472b6; }
.ref-progress-fill--ultra_supporter { background: #fbbf24; }
.ref-progress-fraction {
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
}

/* ===== Recycling Bin ===== */
.recycling-bin-stats {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.bin-stat {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--bg-deep);
    border-radius: 8px;
    border: 1px solid var(--border);
    min-width: 0;
}

.bin-stat-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bin-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Recycling Bin Modal */
.modal.shared-modal.modal-recycle-bin {
    max-width: 680px !important;
    width: 95% !important;
}

.recycling-bin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    gap: 4px;
    overflow-x: auto;
}

.bin-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.bin-tab:hover {
    color: var(--text-primary);
}

.bin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.bin-tab-count {
    font-size: 0.75rem;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text-muted);
    margin-left: 4px;
}

.bin-tab.active .bin-tab-count {
    background: var(--primary);
    color: white;
}

.bin-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px 20px;
}

.bin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.bin-item-cover {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-deep);
}

.bin-item-info {
    flex: 1;
    min-width: 0;
}

.bin-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bin-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.bin-item-expires {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.bin-item-expires.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.bin-item-expires.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.bin-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-bin-restore {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn-bin-restore:hover {
    opacity: 0.85;
}

.btn-bin-delete {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--danger, #ef4444);
    background: none;
    color: var(--danger, #ef4444);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.btn-bin-delete:hover {
    background: var(--danger, #ef4444);
    color: white;
}

.bin-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.bin-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.bin-empty-state p {
    font-size: 0.85rem;
}

/* ===== Name History Popup ===== */
.profile-name-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-name-wrap h1 {
    margin: 0;
}

.profile-name-wrap.has-history h1 {
    cursor: pointer;
}

.profile-name-wrap.has-history h1::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-name-wrap.has-history:hover h1::after {
    opacity: 0.6;
}

.name-history-popup {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    min-width: 220px;
    max-width: 300px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 12px 0;
    animation: nameHistoryFadeIn 0.15s ease-out;
}

.name-history-popup.visible {
    display: block;
}

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

.name-history-header {
    padding: 0 14px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.name-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.name-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    gap: 12px;
}

.name-history-item:hover {
    background: var(--bg-deep);
}

.name-history-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.name-history-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== Favorites List View (Anime List Tab) ===== */
/* ===== BACKLOG ROULETTE ===== */
.roulette-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--primary);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    position: relative;
}

.roulette-btn:hover {
    background: rgba(var(--primary-rgb), 0.12);
    transform: scale(1.1);
}

.roulette-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.roulette-btn:hover .roulette-tooltip {
    opacity: 1;
}

.roulette-wheel-icon {
    width: 30px;
    height: 30px;
    animation: roulette-wheel-spin 6s linear infinite;
}

.roulette-btn:hover .roulette-wheel-icon {
    animation-duration: 0.6s;
}

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

.roulette-modal {
    max-width: 540px;
    width: 92vw;
    padding: 0;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.roulette-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
}

.roulette-close:hover {
    background: rgba(0,0,0,0.5);
}

.roulette-close svg {
    width: 16px;
    height: 16px;
}

.roulette-header {
    text-align: center;
    padding: 28px 24px 16px;
}

.roulette-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}

.roulette-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.roulette-body {
    padding: 0 24px;
}

.roulette-slot-window {
    position: relative;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.roulette-slot-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 100%;
    transition: transform 0.1s linear;
    will-change: transform;
}

.roulette-slot-strip.spinning {
    transition: none;
}

.roulette-slot-strip.decelerating {
    transition: transform 4s cubic-bezier(0.12, 0.8, 0.2, 1);
}

.roulette-slot-item {
    flex-shrink: 0;
    width: 110px;
    height: 160px;
    margin: 0 6px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.roulette-slot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.roulette-slot-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}

.roulette-slot-fade-left {
    left: 0;
    background: linear-gradient(to right, var(--bg-surface), transparent);
}

.roulette-slot-fade-right {
    right: 0;
    background: linear-gradient(to left, var(--bg-surface), transparent);
}

.roulette-slot-pointer {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid var(--primary);
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(var(--primary-rgb), 0.4));
}

.roulette-result {
    margin-top: 20px;
    animation: roulette-result-in 0.4s ease;
}

@keyframes roulette-result-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.roulette-result-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.roulette-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.roulette-result-card:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    background: rgba(var(--primary-rgb), 0.12);
}

.roulette-result-card img {
    width: 52px;
    height: 74px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

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

.roulette-result-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.roulette-result-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.roulette-result-action {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.roulette-footer {
    padding: 20px 24px 24px;
    display: flex;
    justify-content: center;
}

.roulette-spin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.roulette-spin-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.4);
}

.roulette-spin-btn:active {
    transform: translateY(0);
}

.roulette-spin-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.roulette-spin-btn.spinning {
    opacity: 0.7;
    pointer-events: none;
}

.roulette-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: var(--text-muted);
}

.roulette-empty-state svg {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    opacity: 0.35;
}

.roulette-empty-state p {
    font-size: 0.82rem;
    margin: 0;
}

/* Widget Config - Redesigned */
.widget-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.widget-config-group {
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 12px;
    padding: 16px;
}

.widget-config-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
}

.widget-config-group-header svg {
    color: var(--primary);
    opacity: 0.8;
}

.widget-config-saved {
    margin-left: auto;
    font-size: 0.7rem;
    color: #22c55e;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget-config-saved.show {
    opacity: 1;
}

.widget-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.widget-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.widget-check-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.widget-check-item:has(input:checked) {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.3);
    color: var(--text-primary);
}

.widget-check-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.widget-check-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.widget-check-box::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--primary);
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.widget-check-item:has(input:checked) .widget-check-box {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.widget-check-item:has(input:checked) .widget-check-box::after {
    opacity: 1;
    transform: scale(1);
}

.widget-actions {
    display: flex;
    gap: 12px;
}

.btn-widget-preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--primary-rgb), 0.08));
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-widget-preview:hover {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.25), rgba(var(--primary-rgb), 0.15));
    border-color: rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px);
}

.btn-widget-preview svg {
    opacity: 0.8;
}

/* Legacy support */
.widget-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.widget-check input[type="checkbox"] {
    accent-color: var(--primary);
}

.widget-theme-btn.active,
.widget-size-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Walkthrough Replay Buttons */
.walkthrough-replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.walkthrough-replay-btn:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: rgba(var(--primary-rgb), 0.4);
    color: var(--text-primary);
}

.walkthrough-replay-btn:active {
    transform: scale(0.97);
}

.walkthrough-replay-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}
