:root {
    --accent: #795eaa;
    --accent-glow: rgba(121, 94, 170, 0.4);
    --bg-dark: #0a090c;
    --card-dark: rgba(25, 24, 31, 0.7);
    --text-main: #f0edee;
    --text-dim: #a099b0;
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(171, 140, 140, 0.08);
    --grad-celestial: linear-gradient(135deg, #795eaa 0%, #4a3a63 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --ts-font: 'Space Grotesk', sans-serif;
}

body {
    font-family: var(--ts-font);
    background-color: var(--bg-dark);
    color: var(--text-main);
    width: 100%;
    position: relative;
    transition: background 0.5s ease, font-family 0.3s ease;
}

html {
    overflow-x: hidden;
        scrollbar-gutter: stable;
}


::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) var(--bg-dark);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

.app-container {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
}

.top-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    padding-top: calc(env(safe-area-inset-top) + 0.8rem); 
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 1000;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.search-trigger {
    transition: color 0.3s ease, transform 0.3s ease;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--grad-celestial);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar {
    width: 280px;
    background: var(--card-dark);
    border-right: 1px solid var(--border);
    padding: 2rem;
    padding-top: calc(env(safe-area-inset-top) + 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
    max-height: none;
    height: auto;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0;
    align-self: flex-start !important;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    z-index: 2;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li:hover {
    background: var(--glass);
    color: var(--text-main);
}

body.ts-mode-light .nav-links li:hover {
    background: rgba(0,0,0,0.07);
    color: #1a1625;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; 
    color: var(--text-dim);
}

.nav-links li.active {
    background: var(--grad-celestial);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: box-shadow 0.1s ease; 
}

.content {
    flex: 1;
    padding: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .bottom-nav { display: flex; }
    
    .top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: calc(env(safe-area-inset-top) + 0.8rem) 1.2rem 0.8rem;
        position: sticky;
        top: 0;
        background: var(--bg-dark);
        z-index: 1000;
        border-bottom: none;
        height: auto;
        --top-bar-height: calc(env(safe-area-inset-top) + 53px);
    }

    .feed-switcher {
        position: -webkit-sticky;
        position: sticky;
        top: var(--top-bar-height, 53px);
        z-index: 999;
        margin-left: -12px;
        margin-right: -12px;
        padding: 8px 16px 12px;
        width: auto;
        background: var(--bg-dark);
        border-bottom: 1px solid var(--border);
        margin-top: 0;
    }
    
    #inbox .feed-switcher {
        padding-left: 20px !important;
    }

    .content {
        padding: 12px;
        padding-top: 0; 
        padding-bottom: 100px;
    }
}

.page {
    display: none;
    animation: fadeIn 0.6s ease forwards;
}

.page.active {
    display: block;
}

.hero-card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: -1;
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); 
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 24, 31, 0.85);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    padding: 0 20px;
    border-radius: 50px;
    width: 92%;
    max-width: 420px;
    height: 70px; 
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.nav-item {
    color: var(--text-dim);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.nav-item i {
    width: 28px !important;
    height: 28px !important;
}

.nav-item.active {
    color: var(--accent);
}


.create-fab {
    background: var(--grad-celestial);
    color: white !important;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    margin-top: -35px;
    box-shadow: 0 8px 20px var(--accent-glow);
    border: 4px solid var(--bg-dark);
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .top-bar { display: flex; }
    .bottom-nav { display: flex; }
    .content { padding-bottom: 100px; }
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    font-family: 'Space Grotesk', sans-serif;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.auth-card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 32px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .auth-card {
    transform: scale(1) translateY(0);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}

.modal-title { 
    margin-bottom: 8px; 
    font-size: 1.8rem; 
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

.modal-subtitle { 
    color: var(--text-dim); 
    margin-bottom: 24px; 
    font-size: 0.9rem; 
    font-family: 'Space Grotesk', sans-serif;
}

.input-group input {
    width: 100%;
    padding: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    margin-bottom: 16px;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus { 
    border-color: var(--accent); 
    background: rgba(121, 94, 170, 0.1); 
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background: var(--grad-celestial);
    border: none;
    border-radius: 14px;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }

.legal-text { 
    font-size: 0.75rem; 
    color: var(--text-dim); 
    margin-bottom: 20px; 
    line-height: 1.4; 
    font-family: 'Space Grotesk', sans-serif;
}

.error-text { 
    color: #ff5f5f; 
    font-size: 0.85rem; 
    margin-bottom: 15px; 
    font-family: 'Space Grotesk', sans-serif;
}

.resend-container { 
    margin-top: 20px; 
    font-size: 0.8rem; 
    color: var(--text-dim); 
    font-family: 'Space Grotesk', sans-serif;
}

.text-link-btn { 
    background: none; 
    font-family: 'Space Grotesk', sans-serif; 
    border: none; 
    color: var(--accent); 
    font-weight: 600; 
    cursor: pointer; 
    padding: 5px; 
}

.text-link-btn:disabled { color: var(--text-dim); cursor: not-allowed; }

.profile-logged-out, .profile-logged-in { 
    display: none; 
    text-align: center; 
    font-family: 'Space Grotesk', sans-serif;
}

.onboarding-card {
    width: 100%;
    max-width: 500px;
    
    min-height: 500px;
    max-height: 85vh;
    
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-overlay .onboarding-card {
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .onboarding-card {
    transform: scale(1) translateY(0);
}

.onboarding-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}


.onboarding-step {
    animation: stepEnter 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes stepEnter {
    from { 
        opacity: 0; 
        transform: translateX(40px) scale(0.95); 
        filter: blur(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
        filter: blur(0); 
    }
}

.topic-chip {
    opacity: 0;
    transform: translateY(20px);
    animation: chipPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes chipPop {
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.avatar-wrapper {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    z-index: 20;
}

.avatar-preview {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    border: 5px solid var(--card-dark);
    border-radius: 50% !important;
    overflow: hidden;
    position: relative;
}

.avatar-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    z-index: 9999;
    width: 36px;
    height: 36px;
    background: #1a191f;
    border: 2px solid var(--card-dark);
}


@keyframes stepSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.step-header {
    text-align: center;
    margin-bottom: 32px;
}

.step-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(121, 94, 170, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--accent);
}

.profile-upload-zone {
    position: relative;
    margin-bottom: 90px;
}

.banner-preview {
    width: 100%;
    height: 120px;
    background: var(--grad-celestial, linear-gradient(135deg, #2b1c44 0%, #4a3a63 50%, #795eaa 100%));
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

.banner-preview:hover { 
    transform: scale(1.03);
}

.avatar-preview {
    width: 100px;
    height: 100px;
    background: var(--bg-dark);
    border: 5px solid var(--card-dark);
    border-radius: 50% !important;
    position: absolute;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.avatar-preview:hover {
    transform: scale(1.05);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.upload-btn {
    position: absolute;
    width: 38px;
    height: 38px;
    
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.upload-btn i {
    width: 18px;
    height: 18px;
}

.upload-btn:hover {
    background: var(--accent);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.banner-btn { 
    top: 16px; 
    right: 16px; 
}

.avatar-btn {
    bottom: -4px;
    right: -4px;
    z-index: 999999;
    width: 36px;
    height: 36px;
}

#btn-save-profile, 
.onboarding-footer {
    margin-top: 40px;
    padding-top: 10px;
}

.topic-grid {
    padding-bottom: 20px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 20px 0 8px 4px;
}

.input-group input, 
.input-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus, 
.input-group textarea:focus {
    background: rgba(121, 94, 170, 0.08);
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 20px rgba(121, 94, 170, 0.15);
}

.input-group textarea {
    resize: none;
    overflow-y: auto;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.topic-chip {
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    text-align: center;
}

.topic-chip i { width: 20px; height: 20px; color: var(--text-dim); transition: 0.3s; }

.topic-chip:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--text-dim);
    transform: translateY(-2px);
}

.topic-chip.selected {
    background: var(--grad-celestial);
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 20px rgba(121, 94, 170, 0.3);
}

.topic-chip.selected i { color: white; }

textarea::-webkit-scrollbar { width: 4px; }
textarea::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.upload-btn:has([data-lucide="trash-2"]) {
    background: rgba(255, 70, 70, 0.2);
    border-color: rgba(255, 70, 70, 0.4);
    color: #ff4646;
}

.upload-btn:has([data-lucide="trash-2"]):hover {
    background: #ff4646;
    color: white;
    box-shadow: 0 0 15px rgba(255, 70, 70, 0.5);
}

.profile-container {
    animation: fadeIn 0.8s ease;
}

.profile-header {
    position: relative;
    margin-bottom: 60px;
}

.profile-banner, 
.banner-preview {
    width: 100%;
    aspect-ratio: 4 / 1; 
    height: auto; 
    
    background-color: #2b1c44;
    background-image: var(--grad-celestial);
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.banner-preview {
    border-radius: 15px;
    max-height: 160px;
}

@media (max-width: 480px) {
    .profile-banner {
        aspect-ratio: 4 / 1;
        border-radius: 16px;
    }
}

.profile-avatar-wrapper {
    position: absolute;
    bottom: -35px;
    left: 10px;
    width: 110px;
    height: 110px;
    z-index: 5;
    overflow: hidden;
    border-radius: 50%;
}

#edit-profile-modal .auth-card {
    width: 100%;
    max-width: 500px;
    min-height: 500px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    .edit-btn span {
        display: none;
    }
}

#edit-profile-modal .auth-card {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

#edit-profile-modal.active .auth-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#edit-profile-modal {
    transition: opacity 0.4s ease, visibility 0.4s;
    visibility: hidden;
    display: flex !important;
}

#edit-profile-modal.active {
    visibility: visible;
    opacity: 1;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid var(--bg-dark);
    background: var(--card-dark);
    object-fit: cover;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    gap: 12px;
}

.edit-btn {
    background: var(--glass);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 20px;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button, input, textarea, select, .modal-title, .modal-subtitle,
.action-btn, .primary-btn, .edit-btn, .text-link-btn,
.post-content, .comment-text, .comment-action, .dropdown-item,
.nav-links li, .feed-tab, .ts-pill, .genre-chip, .track-title,
.haven-card-name, .notif-text, .settings-row-left, .ts-toggle-title,
.ts-toggle-sub, .author-display, .author-handle, .profile-name,
.profile-handle, .profile-bio, .stat-label, .stat-value {
    font-family: var(--ts-font) !important;
}

.edit-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--text-dim); }

.profile-info { margin-top: 10px; padding: 0 10px; }
.profile-name { font-size: 1.8rem; font-weight: 700; margin-bottom: 2px; }
.profile-handle { color: var(--accent); font-weight: 500; margin-bottom: 15px; }
.profile-bio { color: var(--text-dim); line-height: 1.6; max-width: 600px; margin-bottom: 20px; }

.profile-stats {
    display: flex;
    gap: 30px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-weight: 700; font-size: 1.1rem; }
.stat-label { color: var(--text-dim); font-size: 0.85rem; }

.shimmer {
    background: linear-gradient(90deg, var(--card-dark) 25%, #1d1c24 50%, var(--card-dark) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

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

.shimmer-text { height: 20px; margin-bottom: 10px; width: 60%; }
.shimmer-banner { height: 200px; width: 100%; border-radius: 24px; }
.shimmer-avatar { width: 110px; height: 110px; border-radius: 50%; }

#composer-modal {
    display: flex !important; 
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(0px);
    position: fixed;
    inset: 0;
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    
}

#composer-modal.active {
    visibility: visible;
    opacity: 1;
    backdrop-filter: blur(12px);
}

.composer-card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 600px;
    border-radius: 28px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    
    transform: scale(0.85) translateY(40px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
    opacity: 0;
}

#composer-modal.active .composer-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.composer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.composer-body {
    padding: 24px;
    max-height: 70vh;
    overflow: visible;
    overflow-y: auto;
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    position: relative;
}

.composer-action-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.composer-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.composer-action-btn.active {
    background: rgba(121, 94, 170, 0.15);
    color: var(--accent);
}

.composer-action-btn i {
    width: 20px;
    height: 20px;
}

#emoji-picker-floating {
    position: fixed;
    z-index: 9999;
    display: none;
}

#emoji-picker-floating em-emoji-picker {
    width: 320px;
    height: 360px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);

    --em-rgb-background: 20, 19, 26;
    --em-rgb-input: 35, 34, 42;
    --em-rgb-color: 240, 237, 238;
    --em-rgb-accent: 121, 94, 170;
    --em-color-border: rgba(255,255,255,0.07);
    --em-color-border-over: rgba(121,94,170,0.5);
    --em-font-family: var(--ts-font);
    --em-font-size: 14px;
    --em-emoji-size: 22px;
    --em-emoji-padding: 5px;
    --em-category-button-size: 20px;
    --em-preview-height: 56px;
}

@media (max-width: 768px) {
    #composer-modal {
        align-items: flex-end;
        padding: 0;
    }

    .composer-card {
        max-width: 100%;
        border-radius: 32px 32px 0 0;
        border-bottom: none;
        
        transform: translateY(105%); 
        opacity: 1; 
        transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    }

    #composer-modal.active .composer-card {
        transform: translateY(0);
    }
}

#composer-modal:not(.active) .composer-card {
    transition: transform 0.3s ease-in, opacity 0.3s;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
}

@media (max-width: 768px) {
    #composer-modal:not(.active) .composer-card {
        transform: translateY(100%);
    }
}

.close-composer-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    color: var(--text-dim);
    transition: 0.3s;
}

.close-composer-btn:hover { color: var(--text-main); }

.composer-user-area {
    display: flex;
    gap: 18px;
    margin-top: 45px;
    padding: 0 5px;
}

.composer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
}

.composer-input-wrapper { flex: 1; }

#post-content {
    width: 100%;
    min-height: 120px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    padding-top: 10px;
}

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 24px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid var(--border);
}

.composer-tools { display: flex; align-items: center; gap: 20px; }

.ai-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
        cursor: pointer;

}

.ai-label i {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.ai-toggle:hover .ai-label {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-dim);
    color: var(--text-main);
}

.ai-toggle input:checked + .ai-label {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.ai-toggle input:checked + .ai-label i {
    transform: scale(1.2) rotate(15deg);
    color: #fff;
}

.ai-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

#btn-publish-post:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
    transform: scale(0.98);
    box-shadow: none;
}

#btn-publish-post {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-dim);
}

#btn-publish-post {
    width: auto;
    padding: 10px 25px;
    border-radius: 50px;
    gap: 8px;
        display: flex;
    align-items: center;
    justify-content: center;

}

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    padding-bottom: 100px;
}

.feed-container + .feed-container,
.profile-container .feed-container {
    margin-top: 0;
}

.post-card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    animation: slideUp 0.4s cubic-bezier(0, 0, 0.2, 1);
}

.post-card:hover {
    border-color: rgba(121, 94, 170, 0.3);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.post-author-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.post-pfp {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border);
}

.author-names {
    display: flex;
    flex-direction: column;
}

.author-display {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.author-handle {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.7rem;
    border: 1px solid var(--accent);
}

.post-content, .comment-text, .profile-bio {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: normal;
}

.post-card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    animation: slideUp 0.4s cubic-bezier(0, 0, 0.2, 1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.post-content p, .comment-text p, .profile-bio p { 
    margin-bottom: 1rem; 
}
.post-content p:last-child, .comment-text p:last-child, .profile-bio p:last-child { 
    margin-bottom: 0; 
}

.post-content a, .comment-text a, .profile-bio a { 
    color: var(--accent); 
    text-decoration: none; 
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}
.post-content a:hover, .comment-text a:hover, .profile-bio a:hover { 
    border-bottom-color: var(--accent);
    background: var(--accent-glow);
}

.post-content h1, .post-content h2, .post-content h3,
.profile-bio h1, .profile-bio h2, .profile-bio h3 {
    margin: 1.5rem 0 0.8rem;
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.2;
}
.post-content h1, .profile-bio h1 { font-size: 1.4rem; }
.post-content h2, .profile-bio h2 { font-size: 1.2rem; }
.post-content h3, .profile-bio h3 { font-size: 1.1rem; }

.post-content ul, .comment-text ul, .profile-bio ul,
.post-content ol, .comment-text ol, .profile-bio ol { 
    padding-left: 1.5rem; 
    margin-bottom: 1rem; 
}
.post-content li, .comment-text li, .profile-bio li {
    margin-bottom: 0.4rem;
}

.post-content blockquote, .profile-bio blockquote {
    border-left: 4px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: rgba(121, 94, 170, 0.05);
    border-radius: 0 12px 12px 0;
    color: var(--text-dim);
    font-style: italic;
}

.post-content code, .comment-text code, .profile-bio code { 
    background: rgba(255, 255, 255, 0.08); 
    padding: 2px 6px; 
    border-radius: 6px; 
    font-family: 'Courier New', Courier, monospace; 
    font-size: 0.9em;
    color: var(--accent);
}

.post-content pre, .profile-bio pre {
    background: #000;
    padding: 1rem;
    border-radius: 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 1rem 0;
}
.post-content pre code, .profile-bio pre code {
    background: transparent;
    padding: 0;
    color: var(--text-main);
}

.post-content hr, .profile-bio hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

.shimmer-card {
    min-height: 80px;
    background: var(--card-dark);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.shimmer-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: shimmerMove 1.5s infinite;
}

@keyframes shimmerMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

.feed-container::after {
    display: block;
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.feed-container:has(.post-card):not(:empty)::after {
    opacity: 0.5;
}

.feed-composer-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 14px 20px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; 
}

.feed-composer-box:hover {
    border-color: rgba(121, 94, 170, 0.4);
    background: rgba(25, 24, 31, 0.9);
}

@media (max-width: 480px) {
    .feed-composer-box {
        padding: 12px 16px;
        gap: 10px;
    }
}

.feed-composer-placeholder {
    color: var(--text-dim);
    font-size: 1rem;
    user-select: none;
}

.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.like-btn.liked {
    color: #ff4d6d;
    border-color: rgba(255, 77, 109, 0.3);
    background: rgba(255, 77, 109, 0.08);
}

.like-btn.liked i,
.like-btn.liked svg {
    fill: #ff4d6d;
    color: #ff4d6d;
}

.like-btn:hover {
    color: #ff4d6d !important;
    border-color: rgba(255, 77, 109, 0.3) !important;
    background: rgba(255, 77, 109, 0.08) !important;
}

.like-count {
    font-size: 0.8rem;
}

@keyframes heartPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    70%  { transform: scale(0.88); }
    100% { transform: scale(1); }
}

.like-btn.animate-heart i,
.like-btn.animate-heart svg {
    animation: heartPop 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

.post-card {
    user-select: none;
    -webkit-user-select: none;
}

.post-content {
    user-select: text;
    -webkit-user-select: text;
}

.ai-label-btn {
    color: var(--accent) !important;
    border-color: rgba(121, 94, 170, 0.35) !important;
    background: rgba(121, 94, 170, 0.08) !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

.ai-label-btn:hover {
    background: rgba(121, 94, 170, 0.18) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 12px var(--accent-glow);
}

.ai-label-btn svg,
.ai-label-btn i {
    color: var(--accent);
}

.post-menu-btn {
    padding: 4px 8px !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-dim) !important;
}

.post-menu-btn:hover {
    background: rgba(255,255,255,0.06) !important;
    color: var(--text-main) !important;
}

.post-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1a1920;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    z-index: 999;
    min-width: 160px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    animation: fadeIn 0.15s ease forwards;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.06);
}

.dropdown-item.danger {
    color: #ff4646;
}

.dropdown-item.danger:hover {
    background: rgba(255, 70, 70, 0.1);
}
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    justify-content: flex-end;
}

.drawer-overlay.active { display: flex; }

.drawer-content {
    background: var(--bg-dark);
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    animation: slideRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@media (max-width: 768px) {
    .drawer-overlay { align-items: flex-end; }
    .drawer-content {
        height: 85vh;
        border-radius: 24px 24px 0 0;
        animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0;
    opacity: 0;
    transform: translateY(8px);
    animation: commentAppear 0.35s ease forwards;
}

@keyframes commentAppear {
    to { opacity: 1; transform: translateY(0); }
}

.comment-bubble {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    border-top-left-radius: 5px;
    padding: 10px 14px 8px;
    position: relative;
    transition: border-color 0.2s ease;
}

.comment-bubble:hover {
    border-color: rgba(121, 94, 170, 0.3);
}

.comment-bubble:hover .comment-menu-btn {
    opacity: 1;
}

.comment-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-main);
    margin-top: 3px;
    word-break: break-word;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding-left: 2px;
}

.comment-action {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s ease, color 0.2s ease;
}

.comment-action:hover { 
    background: rgba(255, 255, 255, 0.05); 
    color: var(--text-main); 
}

.like-comment-btn:hover { 
    color: #ff4d6d !important; 
    background: rgba(255, 77, 109, 0.1) !important; 
}

.reply-comment-btn:hover { 
    color: var(--accent) !important; 
    background: rgba(121, 94, 170, 0.1) !important; 
}


.comment-action:active { transform: scale(0.95); }

.comment-action.liked { color: #ff4d6d; }

.comment-action.liked svg,
.comment-action.liked i {
    fill: #ff4d6d;
    color: #ff4d6d;
}

.comment-action.animate-heart svg,
.comment-action.animate-heart i {
    animation: heartPop 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

.comment-menu-btn {
    opacity: 0;
    padding: 2px 4px !important;
    color: var(--text-dim);
    transition: opacity 0.2s ease;
    margin-left: auto;
}

.drawer-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 8px;
}

.comment-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(255,255,255,0.01);
}

.comment-box {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 10px 16px;
    min-height: 40px;
    color: var(--text-main);
    resize: none;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.comment-box:focus {
    border-color: var(--accent);
    background: rgba(121, 94, 170, 0.06);
}

.comment-send-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--grad-celestial);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-self: flex-end;
    margin-bottom: 1px;
}

.comment-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px var(--accent-glow);
}

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

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@keyframes slideDownOut {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

.drawer-content.closing {
    animation: slideOutRight 0.3s forwards cubic-bezier(0.7, 0, 0.84, 0);
}

@media (max-width: 768px) {
    .drawer-content.closing {
        animation: slideDownOut 0.3s forwards cubic-bezier(0.7, 0, 0.84, 0);
    }
}

.post-image-wrap {
    margin-top: 12px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    min-height: 60px;
    max-width: 100%;
}

.post-image-wrap > div {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.post-image-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.03);
    transition: opacity 0.3s ease;
}

.post-image-wrap.loaded::before {
    opacity: 0;
    pointer-events: none;
}

.post-image {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.post-image-wrap.loaded .post-image {
    opacity: 1;
}

#image-lightbox.active {
    opacity: 1;
}

#image-lightbox {
    opacity: 0;
    transition: opacity 0.25s ease;
}

#lightbox-img {
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#image-lightbox.active #lightbox-img {
    transform: scale(1);
}

.preview-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
}

.preview-item {
    position: relative;
    flex: 0 0 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid var(--border);
}

.carousel-viewport {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 12px;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: center;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.carousel-viewport:hover .carousel-nav { opacity: 1; }

.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}

.dot.active { background: #fff; width: 12px; border-radius: 4px; }

.genre-chip {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.genre-chip:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
.genre-chip.active { background: rgba(121,94,170,0.2); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.track-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.track-result:hover { background: rgba(255,255,255,0.05); border-color: var(--border); }
.track-result.playing { background: rgba(121,94,170,0.1); border-color: rgba(121,94,170,0.3); }

.track-cover-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.track-cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.track-cover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: white;
}
.track-cover-wrap:hover .track-cover-overlay,
.track-result.playing .track-cover-overlay { opacity: 1; }

.track-info { flex: 1; overflow: hidden; }
.track-title { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 0.76rem; color: var(--text-dim); margin-top: 2px; }

.track-attach-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.track-attach-btn:hover, .track-result.selected .track-attach-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.post-audio-player {
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-audio-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
}

.post-audio-top img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.post-audio-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.post-audio-title { 
    font-weight: 700; 
    font-size: 0.85rem; 
    line-height: 1.3;
    white-space: normal; 
    overflow-wrap: break-word; 
    display: block;
    color: var(--text-main);
}.post-audio-artist { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .post-audio-progress {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0 12px;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                    opacity 0.3s ease, 
                    padding 0.4s ease;
    }
    
    .post-audio-progress.visible {
        max-height: 60px;
        opacity: 1;
        padding: 0 12px 12px;
    }

.progress-bar-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s linear;
}

.post-audio-player {
    animation: celestialEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

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

.progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.post-audio-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.post-audio-play:hover {
    transform: scale(1.1);
}

.post-audio-play:active {
    transform: scale(0.92);
}

.streaming-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    width: 100%;
}

.stream-btn {
    padding: 10px 2px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.65rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-right: 1px solid var(--border);
    transition: all 0.2s;
}

.stream-btn:last-child { border-right: none; }
.stream-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }

@media (max-width: 480px) {
    .streaming-links { grid-template-columns: repeat(3, 1fr); }
    .stream-btn { font-size: 0.6rem; padding: 8px 2px; gap: 3px; }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

@keyframes celestial-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning svg, 
.spinning i {
    animation: celestial-spin 1s linear infinite !important;
}

.reply-item {
    margin-left: 36px;
    position: relative;
    padding-top: 8px;
}

.reply-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: -10px;
    bottom: 20px;
    width: 2px;
    background: rgba(121, 94, 170, 0.15);
}

.reply-item::after {
    content: '';
    position: absolute;
    left: -20px;
    top: 20px;
    width: 15px;
    height: 2px;
    background: rgba(121, 94, 170, 0.15);
}

.creator-badge {
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    border: 1px solid var(--accent);
    text-transform: uppercase;
}

.reply-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(121, 94, 170, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.view-replies-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 48px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-replies-btn:hover { text-decoration: underline; }


.sort-container .genre-chip {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
}

.sort-container .genre-chip.active {
    background: rgba(121, 94, 170, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}


.profile-nav-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem 1.5rem;
    margin: 0 -1.5rem 10px -1.5rem;
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav-user-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.back-btn:hover { background: rgba(255,255,255,0.1); }

body.hide-nav .sidebar,
body.hide-nav .bottom-nav,
body.hide-nav .top-bar {
    display: none !important;
}

@media (max-width: 768px) {
    .profile-nav-header {
        padding: 0.8rem 1rem;
        margin: 0 -12px 10px -12px;
    }
}


.profile-animate-in {
    animation: profileSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.avatar-pop {
    animation: avatarSpring 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform: scale(0);
}

@keyframes avatarSpring {
    to { transform: scale(1); }
}

.info-stagger {
    opacity: 0;
    animation: infoFade 0.5s ease forwards;
}

.info-stagger:nth-child(1) { animation-delay: 0.1s; }
.info-stagger:nth-child(2) { animation-delay: 0.2s; }
.info-stagger:nth-child(3) { animation-delay: 0.3s; }

@keyframes infoFade {
    to { opacity: 1; transform: translateY(0); }
}

.stat-item-animate {
    opacity: 0;
    transform: translateX(-10px);
    animation: statSlide 0.4s ease forwards;
}

.stat-item-animate:nth-child(1) { animation-delay: 0.4s; }
.stat-item-animate:nth-child(2) { animation-delay: 0.5s; }
.stat-item-animate:nth-child(3) { animation-delay: 0.6s; }

@keyframes statSlide {
    to { opacity: 1; transform: translateX(0); }
}

.founding-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.founding-badge i, 
.founding-badge svg {
    width: 12px;
    height: 12px;
    fill: var(--accent);
}

@media (max-width: 480px) {
    .profile-name {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    .founding-badge {
        font-size: 0.62rem;
        padding: 2px 8px;
    }
}

.follow-btn {
    height: 42px;
    min-width: 110px;
    padding: 0 20px;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid transparent;
}

.follow-btn span { 
    display: none; 
}

.follow-btn.not-following .text-follow { 
    display: inline; 
}

.follow-btn.is-following .text-following { 
    display: inline; 
}

.follow-btn.is-following:hover .text-following { 
    display: none; 
}
.follow-btn.is-following:hover .text-unfollow { 
    display: inline; 
}

.follow-btn.not-following {
    background: var(--grad-celestial);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.follow-btn.is-following {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border);
}

.follow-btn.is-following .text-unfollow { display: none; }

.follow-btn.is-following:hover {
    background: rgba(255, 70, 70, 0.12);
    border-color: rgba(255, 70, 70, 0.3);
    color: #ff5f5f;
}

.follow-btn.is-following:hover .text-following { display: none; }
.follow-btn.is-following:hover .text-unfollow { display: inline; }

.follow-btn:active {
    transform: scale(0.92);
}

@keyframes follow-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.btn-animate-pop {
    animation: follow-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}



.new-posts-pill {
    position: fixed;
    top: 130px; 
    left: 50%;
    transform: translate(-50%, -20px);
    background: var(--accent);
    color: white;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 2500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (min-width: 769px) {
    .new-posts-pill {
        margin-left: 140px;
    }
}

.new-posts-pill.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.new-posts-pill:hover {
    background: #8a6bc2;
    transform: translate(-50%, -2px) scale(1.05);
}

.static-pill-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.static-pill-container.visible {
    height: 80px;
    opacity: 1;
    margin-top: 10px;
}

.static-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 22px;
    background: rgba(121, 94, 170, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.static-pill:hover {
    background: rgba(121, 94, 170, 0.18);
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 5px 15px rgba(121, 94, 170, 0.2);
}

.static-pill i, .new-posts-pill i {
    width: 16px;
    height: 16px;
}

.feed-switcher {
    display: flex;
    gap: 10px;
    padding: 16px 0;
    align-items: center;
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
}

.feed-switcher::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    #inbox .feed-switcher {
        padding-left: 4px;
    }
}

.feed-tab {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.feed-tab i { width: 14px; height: 14px; }

.feed-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.feed-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.feed-tab.active i { color: white; }

@media (max-width: 768px) {
    .feed-switcher {
        top: var(--top-bar-height, 53px);
        margin-left: -12px;
        margin-right: -12px;
        padding: 8px 16px 12px;
        width: auto;
        background: var(--bg-dark);
        border-bottom: 1px solid var(--border);
    }

    #inbox .feed-switcher {
        padding-left: 16px !important;
    }
}

.date-separator {
    display: flex;
    justify-content: center;
    margin: 40px 0 20px;
    position: relative;
}

.date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
    z-index: 1;
}

.date-pill {
    background: #1a1920;
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.date-pill i {
    width: 12px;
    height: 12px;
    color: var(--accent);
}

.btn-tune-desktop {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dim);
    margin-left: 10px;
}

@media (max-width: 768px) {
    .btn-tune-desktop { display: none !important; }
}

.btn-tune-desktop:hover {
    background: var(--glass);
    color: var(--text-main);
}

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; border: 1px solid var(--border); }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

.shared-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(121, 94, 170, 0.1);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 12px;
    border: 1px solid var(--accent);
    animation: fadeIn 0.5s ease;
}

.shared-tag i {
    width: 12px;
    height: 12px;
}

.share-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 10px;
    animation: fadeIn 0.3s ease;
}

.share-option-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}

.share-option-btn:hover {
    transform: translateY(-4px);
}

.share-option-btn span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-dim);
    font-family: 'Space Grotesk', sans-serif;
    text-align: center;
    width: 100%;
    white-space: nowrap;
}

.share-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.share-option-btn:hover .share-icon-circle {
    filter: brightness(1.15);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.share-icon-circle i, .share-icon-circle svg {
    width: 20px;
    height: 20px;
}

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

.haven-card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.5s ease forwards;
}

.haven-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.haven-card-banner {
    height: 80px;
    background: var(--grad-celestial);
    background-size: cover;
    background-position: center;
}

.haven-card-content {
    padding: 0 16px 16px;
    margin-top: -30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.haven-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--bg-dark);
    border: 4px solid var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    color: white;
}

.haven-card-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }

.haven-card-name { font-weight: 700; font-size: 1.1rem; color: var(--text-main); }
.haven-card-handle { color: var(--accent); font-size: 0.8rem; margin-bottom: 12px; font-weight: 600; }
.haven-card-stats { display: flex; gap: 15px; font-size: 0.75rem; color: var(--text-dim); }

#glyph-selector {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 18px;
    border: 1px solid var(--border);
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

#glyph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 42px); 
    justify-content: space-between;
    gap: 8px;
    max-height: 200px; 
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 20px;
}

.glyph-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.glyph-btn i, .glyph-btn svg {
    width: 20px;
    height: 20px;
}

.glyph-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.glyph-btn.active {
    background: var(--accent);
    color: white;
    border-color: transparent;
}

#haven-color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 5px;
    justify-content: flex-start;
}

.color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(0,0,0,0.3);
    transition: 0.2s;
    flex-shrink: 0;
}

.color-dot:hover { transform: scale(1.2); }
.color-dot.active { 
    border-color: white; 
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

#glyph-grid::-webkit-scrollbar { width: 4px; }
#glyph-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.join-btn {
    height: 42px;
    min-width: 100px;
    padding: 0 20px;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.join-btn .text-join,
.join-btn .text-joined,
.join-btn .text-leave { display: none; }

.join-btn.not-joined .text-join { display: inline; }
.join-btn.is-joined .text-joined { display: inline; }
.join-btn.is-joined:hover .text-joined { display: none; }
.join-btn.is-joined:hover .text-leave { display: inline; }

.join-btn.not-joined {
    background: var(--grad-celestial);
    color: white;
}

.join-btn.is-joined {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border);
}

.join-btn.is-joined .text-leave { display: none; }
.join-btn.is-joined:hover {
    background: rgba(255, 70, 70, 0.12);
    border-color: rgba(255, 70, 70, 0.3);
    color: #ff5f5f;
}
.join-btn.is-joined:hover .text-joined { display: none; }
.join-btn.is-joined:hover .text-leave { display: inline; }

#haven-picker-results .shimmer-card {
    margin-bottom: 8px;
}

.picker-haven-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.picker-haven-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.picker-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.picker-icon-box img { width: 100%; height: 100%; object-fit: cover; }

.picker-section-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 20px 0 10px 5px;
}

.post-haven-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-left: 2px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    transition: 0.2s;
    cursor: pointer;
}

.post-haven-tag:hover {
    color: var(--accent);
    background: rgba(121, 94, 170, 0.1);
}

.haven-target-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(121, 94, 170, 0.1);
    border: 1px solid rgba(121, 94, 170, 0.2);
    padding: 6px 14px;
    border-radius: 50px;
    color: var(--accent);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.haven-target-btn:hover {
    background: rgba(121, 94, 170, 0.2);
    border-color: var(--accent);
}

#haven-picker-modal .input-group div,
#haven-main-search-wrap {
    padding: 10px 16px !important; 
    gap: 12px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border) !important;
    display: flex !important;
    align-items: center !important;
}

#haven-search-input,
#haven-main-search {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    width: 100% !important;
    font-size: 0.95rem !important;
    color: var(--text-main) !important;
    outline: none !important;
    box-shadow: none !important;
}

#haven-search-input::placeholder,
#haven-main-search::placeholder {
    color: var(--text-dim);
}

#explore-search-input {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    width: 100% !important;
    font-size: 1rem !important;
    color: var(--text-main) !important;
    outline: none !important;
    box-shadow: none !important;
}

.top-match-card {
    background: linear-gradient(135deg, rgba(121, 94, 170, 0.15) 0%, rgba(25, 24, 31, 0.7) 100%);
    border: 1px solid var(--accent);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: fadeIn 0.4s ease;
}

body.ts-mode-light .top-match-card {
    background: linear-gradient(135deg, rgba(121, 94, 170, 0.1) 0%, rgba(255,255,255,0.9) 100%) !important;
    border-color: var(--accent) !important;
}

body.ts-mode-light .top-match-card .author-display { color: #1a1625 !important; }
body.ts-mode-light .top-match-card .author-handle  { color: #6b6280 !important; }
body.ts-mode-light .people-result-card             { background: rgba(255,255,255,0.95) !important; }

.top-match-info { flex: 1; min-width: 0; }
.top-match-label { 
    font-size: 0.65rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    color: var(--accent); 
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.people-result-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-dark);
    padding: 12px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}

#explore-main-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

#explore-main-results .post-card {
    margin: 0 !important;
}

#explore-main-results .shimmer-card {
    flex-shrink: 0;
}

#explore-main-results > * {
    animation: searchItemIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#explore-main-results > *:nth-child(1) { animation-delay: 0.00s; }
#explore-main-results > *:nth-child(2) { animation-delay: 0.04s; }
#explore-main-results > *:nth-child(3) { animation-delay: 0.08s; }
#explore-main-results > *:nth-child(4) { animation-delay: 0.12s; }
#explore-main-results > *:nth-child(5) { animation-delay: 0.16s; }
#explore-main-results > *:nth-child(n+6) { animation-delay: 0.20s; }

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

.people-result-card:hover { border-color: var(--text-dim); }

.explore-mini-pfp {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.notif-badge {
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 50px;
    border: 2px solid var(--bg-dark);
    box-shadow: 0 4px 10px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    pointer-events: none;
    line-height: 1;
}

.sidebar .nav-links li .notif-badge {
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .nav-item .notif-badge {
        position: absolute;
        top: 12px;
        right: 8px;
        transform: translate(20%, -20%);
    }
}

.notif-snippet {
    background: rgba(255,255,255,0.03);
    border-left: 2px solid var(--accent);
    padding: 6px 10px;
    border-radius: 4px 10px 10px 4px;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 8px;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar .notif-badge {
    top: 12px;
    right: 12px;
}

.notif-card {
    display: flex;
    gap: 15px;
    padding: 16px;
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.notif-card:hover {
    border-color: var(--text-dim);
    transform: translateY(-2px);
}

.notif-card.unread {
    border-color: var(--accent);
    background: rgba(121, 94, 170, 0.05);
}

.notif-card.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
}

.notif-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.notif-text {
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--text-main);
    flex: 1;
}

.notif-text b {
    color: var(--text-main);
    font-weight: 700;
}

.notif-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

#btn-unblock-inline {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.post-card[data-blocked="true"] {
    display: none;
}

.report-chip:hover {
    border-color: rgba(255,160,50,0.35) !important;
    color: var(--text-main) !important;
    background: rgba(255,160,50,0.06) !important;
}

#send-comment-btn {
    transition: opacity 0.3s ease, transform 0.2s ease;
    opacity: 0.4;
    pointer-events: none;
}

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

.spin {
    animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 120px);
    }

    .action-btn {
        padding: 10px 18px;
    }

    .post-card {
        -webkit-user-select: none;
        user-select: none;
    }
    
    .post-content, .comment-text {
        user-select: text;
        -webkit-user-select: text;
    }
}

@media (max-width: 768px) {
    .post-card, .feed-composer-box {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

.ai-label-btn .text-full { display: inline; }
.ai-label-btn .text-mini { display: none; }

@media (max-width: 550px) {
    .ai-label-btn .text-full { display: none; }
    .ai-label-btn .text-mini { display: inline; }
}

@media (max-width: 400px) {
    .ai-label-btn .text-mini { display: none; }
    .ai-label-btn { padding: 8px 12px; }
}

.settings-section-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 0 4px;
    margin: 28px 0 10px;
}

.settings-group {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
}

.settings-row:last-child {
    border-bottom: none;
}

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

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    font-weight: 500;
}

.settings-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(121, 94, 170, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-row-icon i {
    width: 17px;
    height: 17px;
}

.settings-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.danger-row:hover {
    background: rgba(255, 70, 70, 0.06) !important;
}


.ts-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin: 20px 0 10px;
}

.ts-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ts-pill {
    padding: 7px 14px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ts-pill:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-main);
    border-color: var(--text-dim);
}

.ts-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 700;
}

.ts-accent-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.ts-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.ts-dot:hover { transform: scale(1.2); }
.ts-dot.active {
    border-color: white;
    transform: scale(1.25);
    box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

.ts-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.ts-style-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ts-style-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--text-dim);
    transform: translateY(-2px);
}

.ts-style-card.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
}

.ts-style-preview {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
    position: relative;
}

.ts-style-name {
    font-size: 0.78rem;
    font-weight: 600;
}

.ts-style-desc {
    font-size: 0.68rem;
    color: var(--text-dim);
}

.ts-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.ts-preset-card {
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255,255,255,0.02);
}

.ts-preset-card:hover {
    transform: translateY(-4px);
    border-color: var(--text-dim);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.ts-preset-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.ts-preset-swatch {
    height: 48px;
    width: 100%;
    display: flex;
}

.ts-preset-swatch span {
    flex: 1;
    height: 100%;
}

.ts-preset-info {
    padding: 8px 10px 10px;
}

.ts-preset-emoji { font-size: 1rem; }
.ts-preset-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

.ts-toggles {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
}

.ts-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.ts-toggle-row:last-child { border-bottom: none; }

.ts-toggle-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.ts-toggle-sub {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 2px;
}


body.ts-radius-sharp  { --ts-r: 4px;  --ts-r-lg: 8px;   --ts-r-xl: 10px;  }
body.ts-radius-soft   { --ts-r: 10px; --ts-r-lg: 16px;  --ts-r-xl: 20px;  }
body.ts-radius-round  { --ts-r: 14px; --ts-r-lg: 22px;  --ts-r-xl: 32px;  }
body.ts-radius-pill   { --ts-r: 50px; --ts-r-lg: 50px;  --ts-r-xl: 40px;  }
body.ts-radius-blobby { --ts-r: 30px 14px 30px 14px; --ts-r-lg: 40px 20px 40px 20px; --ts-r-xl: 48px 24px 48px 24px; }

body[class*="ts-radius-"] .post-card        { border-radius: var(--ts-r-xl) !important; }
body[class*="ts-radius-"] .auth-card        { border-radius: var(--ts-r-xl) !important; }
body[class*="ts-radius-"] .onboarding-card  { border-radius: var(--ts-r-xl) !important; }
body[class*="ts-radius-"] .action-btn       { border-radius: var(--ts-r)    !important; }
body[class*="ts-radius-"] .primary-btn      { border-radius: var(--ts-r)    !important; }
body[class*="ts-radius-"] .feed-tab         { border-radius: var(--ts-r)    !important; }
body[class*="ts-radius-"] .comment-bubble   { border-radius: var(--ts-r-lg) !important; }
body[class*="ts-radius-"] .haven-card       { border-radius: var(--ts-r-xl) !important; }
body[class*="ts-radius-"] .nav-links li     { border-radius: var(--ts-r)    !important; }
body[class*="ts-radius-"] .input-group input,
body[class*="ts-radius-"] .input-group textarea { border-radius: var(--ts-r-lg) !important; }

body.ts-density-compact .post-card    { padding: 12px !important; }
body.ts-density-compact .feed-container { gap: 8px !important; }
body.ts-density-compact .post-pfp     { width: 32px !important; height: 32px !important; }
body.ts-density-cozy    .post-card    { padding: 28px !important; }
body.ts-density-cozy    .feed-container { gap: 24px !important; }
body.ts-density-spacious .post-card   { padding: 36px !important; }
body.ts-density-spacious .feed-container { gap: 32px !important; }

body.ts-compact-avatars .post-pfp { width: 32px !important; height: 32px !important; }

body.ts-hover-lift .post-card:hover { transform: translateY(-4px) !important; box-shadow: 0 12px 40px rgba(0,0,0,0.35) !important; }

body.ts-glow .primary-btn  { box-shadow: 0 0 20px var(--accent-glow) !important; }
body.ts-glow .feed-tab.active { box-shadow: 0 0 12px var(--accent-glow) !important; }
body.ts-glow .action-btn:hover { box-shadow: 0 0 10px var(--accent-glow) !important; }

body.ts-reduce-motion *, body.ts-reduce-motion *::before, body.ts-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.15ms !important;
}

body.ts-hide-likes .like-count { display: none !important; }

body.ts-card-ghost .post-card {
    background: transparent !important;
    border-color: rgba(255,255,255,0.06) !important;
}
body.ts-card-bordered .post-card {
    background: transparent !important;
    border: 2px solid var(--border) !important;
}
body.ts-card-floating .post-card {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
    border: none !important;
}
body.ts-card-flat .post-card {
    background: rgba(255,255,255,0.02) !important;
    border: none !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border) !important;
}
body.ts-card-neon .post-card {
    border-color: var(--accent) !important;
    box-shadow: 0 0 16px var(--accent-glow), inset 0 0 30px rgba(var(--accent-rgb), 0.03) !important;
}
body.ts-card-glass .post-card {
    background: rgba(255,255,255,0.04) !important;
    backdrop-filter: blur(20px) !important;
    border-color: rgba(255,255,255,0.1) !important;
}
body.ts-card-paper .post-card {
    background: rgba(240,235,220,0.06) !important;
    border-color: rgba(200,180,140,0.2) !important;
}
body.ts-card-retro .post-card {
    background: #0a0a0a !important;
    border: 2px solid var(--accent) !important;
    border-radius: 0 !important;
    box-shadow: 4px 4px 0 var(--accent) !important;
}

body.ts-sidebar-minimal .sidebar {
    background: transparent !important;
    border-right-color: transparent !important;
}
body.ts-sidebar-accent .sidebar {
    background: linear-gradient(180deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 55%, transparent) 100%) !important;
}
body.ts-sidebar-accent .nav-links li { color: rgba(255,255,255,0.7) !important; }
body.ts-sidebar-accent .nav-links li:hover { background: rgba(255,255,255,0.12) !important; }
body.ts-sidebar-accent .nav-links li.active { background: rgba(255,255,255,0.2) !important; color: white !important; }
body.ts-sidebar-accent .sidebar-logo span { color: white !important; }

body.ts-sidebar-frosted .sidebar {
    backdrop-filter: blur(20px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
}
body:not(.ts-mode-light).ts-sidebar-frosted .sidebar {
    background: rgba(10,9,12,0.4) !important;
    border-right-color: rgba(255,255,255,0.06) !important;
}
body.ts-mode-light.ts-sidebar-frosted .sidebar {
    background: rgba(255,255,255,0.45) !important;
    border-right-color: rgba(0,0,0,0.08) !important;
}

body.ts-mode-light.ts-sidebar-minimal .sidebar { background: transparent !important; border-right-color: transparent !important; }


body.ts-blur-bg .modal-overlay { backdrop-filter: blur(20px) !important; }

body.ts-scrollbar-thin ::-webkit-scrollbar { width: 3px !important; }
body.ts-scrollbar-hidden ::-webkit-scrollbar { display: none !important; }
body.ts-scrollbar-hidden * { scrollbar-width: none !important; }
body.ts-scrollbar-accent ::-webkit-scrollbar-thumb { background-color: var(--accent) !important; }
@keyframes rainbow-scroll {
    0%   { background-color: #ff6b6b; }
    16%  { background-color: #ffa94d; }
    33%  { background-color: #ffd43b; }
    50%  { background-color: #69db7c; }
    66%  { background-color: #4dabf7; }
    83%  { background-color: #cc5de8; }
    100% { background-color: #ff6b6b; }
}
body.ts-scrollbar-rainbow ::-webkit-scrollbar-thumb { animation: rainbow-scroll 4s linear infinite !important; }

@property --accent-hue {
    syntax: '<angle>';
    inherits: true;
    initial-value: 0deg;
}

@keyframes ts-rainbow-accent {
    0%   { --accent-hue: 0deg;   }
    100% { --accent-hue: 360deg; }
}

body.ts-rainbow-mode {
    animation: ts-rainbow-accent 8s linear infinite;
}

body.ts-rainbow-mode {
    --accent: hsl(var(--accent-hue), 70%, 65%);
    --accent-glow: hsla(var(--accent-hue), 70%, 65%, 0.35);
    --grad-celestial: linear-gradient(135deg, hsl(var(--accent-hue), 70%, 65%) 0%, hsl(calc(var(--accent-hue) + 30deg), 70%, 45%) 100%);
}

body {
    transition: background 0.5s ease, font-family 0.3s ease, background-image 0.3s ease;
}

body.ts-style-minimal .sidebar-logo span,
body.ts-style-minimal .nav-links li span { opacity: 0.7; }
body.ts-style-minimal .top-bar { border-bottom: none; background: transparent !important; }
body.ts-style-minimal .post-card { box-shadow: none !important; }

body.ts-style-retro {
    font-family: 'Courier New', monospace !important;
    image-rendering: pixelated;
}
body.ts-style-retro .post-card {
    border: 2px solid var(--accent) !important;
    border-radius: 0 !important;
    box-shadow: 4px 4px 0 var(--accent) !important;
    background: #050505 !important;
}
body.ts-style-retro .primary-btn {
    border-radius: 0 !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.5) !important;
}
body.ts-style-retro .sidebar { border-right: 2px solid var(--accent) !important; border-radius: 0 !important; }

body.ts-style-futuristic .post-card {
    border-left: 2px solid var(--accent) !important;
    border-top: 1px solid rgba(var(--accent-rgb),0.3) !important;
    border-right: 1px solid transparent !important;
    border-bottom: 1px solid transparent !important;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
body.ts-style-futuristic .primary-btn {
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
    border-radius: 0 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.ts-style-rounded .post-card         { border-radius: 32px !important; }
body.ts-style-rounded .auth-card         { border-radius: 40px !important; }
body.ts-style-rounded .primary-btn       { border-radius: 50px !important; }
body.ts-style-rounded .action-btn        { border-radius: 50px !important; }
body.ts-style-rounded .input-group input { border-radius: 24px !important; }
body.ts-style-rounded .comment-bubble    { border-radius: 24px !important; }

body.ts-style-bubbly .post-card   { border-radius: 40px 20px 40px 20px !important; }
body.ts-style-bubbly .action-btn  { border-radius: 20px 8px 20px 8px !important; }
body.ts-style-bubbly .primary-btn { border-radius: 50px !important; }

body.ts-style-newspaper {
    font-family: 'Georgia', serif !important;
}
body.ts-style-newspaper .post-card {
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 24px 0 !important;
}
body.ts-style-newspaper .author-display { font-family: 'Georgia', serif; font-style: italic; }

body.ts-mode-light {
    --bg-dark: #f5f4f8;
    --card-dark: rgba(255,255,255,0.9);
    --text-main: #1a1625;
    --text-dim: #6b6280;
    --glass: rgba(0,0,0,0.03);
    --border: rgba(0,0,0,0.09);
}

body.ts-mode-light .top-bar                { background: rgba(245,244,248,0.97) !important; border-bottom: 1px solid rgba(0,0,0,0.06) !important; }
body.ts-mode-light .bottom-nav             { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .sidebar                { background: rgba(255,255,255,0.9) !important; border-right-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .profile-nav-header     { background: #f5f4f8 !important; }
body.ts-mode-light .feed-switcher          { background: rgba(245,244,248,0.97) !important; }
body.ts-mode-light .drawer-content         { background: #f0eff5 !important; }
body.ts-mode-light .post-dropdown          { background: #ffffff !important; color: #1a1625 !important; }
body.ts-mode-light .dropdown-item          { color: #1a1625 !important; }
body.ts-mode-light .dropdown-item:hover    { background: rgba(0,0,0,0.05) !important; }
body.ts-mode-light .date-pill              { background: #ffffff !important; color: #6b6280 !important; }
body.ts-mode-light .shimmer-card           { background: rgba(0,0,0,0.06) !important; }
body.ts-mode-light .shimmer-card::after    { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent) !important; }

body.ts-mode-light .input-group input,
body.ts-mode-light .input-group textarea   { color: #1a1625 !important; background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light #post-content           { color: #1a1625 !important; }
body.ts-mode-light .comment-box            { background: rgba(0,0,0,0.05) !important; color: #1a1625 !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .haven-search-input,
body.ts-mode-light #explore-search-input,
body.ts-mode-light #haven-main-search      { color: #1a1625 !important; }

body.ts-mode-light .comment-bubble        { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.07) !important; }
body.ts-mode-light .post-card             { background: rgba(255,255,255,0.95) !important; }
body.ts-mode-light .haven-card            { background: rgba(255,255,255,0.95) !important; }
body.ts-mode-light .notif-card            { background: rgba(255,255,255,0.95) !important; }
body.ts-mode-light .feed-composer-box     { background: rgba(255,255,255,0.9) !important; }
body.ts-mode-light .composer-card         { background: #ffffff !important; }
body.ts-mode-light .composer-footer       { background: rgba(0,0,0,0.02) !important; }
body.ts-mode-light .auth-card,
body.ts-mode-light .onboarding-card       { background: #ffffff !important; }
body.ts-mode-light .modal-overlay         { background: rgba(245,244,248,0.7) !important; }

body.ts-mode-light .ts-modal-header       { background: #ffffff !important; }
body.ts-mode-light .ts-pill               { background: rgba(0,0,0,0.04) !important; color: #6b6280 !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .ts-pill:hover         { background: rgba(0,0,0,0.08) !important; color: #1a1625 !important; }
body.ts-mode-light .ts-pill.active        { background: var(--accent) !important; color: white !important; }
body.ts-mode-light .ts-style-card         { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; color: #1a1625 !important; }
body.ts-mode-light .ts-preset-card        { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .ts-preset-name        { color: #1a1625 !important; }
body.ts-mode-light .ts-toggles            { background: rgba(0,0,0,0.03) !important; border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .ts-toggle-row         { border-color: rgba(0,0,0,0.06) !important; }
body.ts-mode-light .ts-toggle-title       { color: #1a1625 !important; }
body.ts-mode-light .ts-toggle-sub         { color: #6b6280 !important; }

body.ts-mode-light .settings-group        { background: rgba(255,255,255,0.95) !important; border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .settings-row          { color: #1a1625 !important; border-color: rgba(0,0,0,0.06) !important; }
body.ts-mode-light .settings-row:hover    { background: rgba(0,0,0,0.03) !important; }
body.ts-mode-light .settings-row-icon     { background: rgba(var(--accent-rgb),0.1) !important; }

body.ts-mode-light .action-btn            { color: #6b6280 !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .action-btn:hover      { background: rgba(0,0,0,0.05) !important; color: #1a1625 !important; }
body.ts-mode-light .genre-chip            { color: #6b6280 !important; border-color: rgba(0,0,0,0.1) !important; background: rgba(0,0,0,0.04) !important; }
body.ts-mode-light .genre-chip:hover      { background: rgba(0,0,0,0.07) !important; color: #1a1625 !important; }
body.ts-mode-light .feed-tab              { background: rgba(0,0,0,0.04) !important; color: #6b6280 !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .feed-tab:hover        { background: rgba(0,0,0,0.08) !important; color: #1a1625 !important; }
body.ts-mode-light .feed-tab.active       { background: var(--accent) !important; color: white !important; border-color: var(--accent) !important; }
body.ts-mode-light .brand-name            { background: var(--grad-celestial); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.ts-mode-light ::-webkit-scrollbar-track { background: #f5f4f8 !important; }
body.ts-mode-light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15) !important; }
body.ts-mode-light .sidebar               { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .nav-links li          { color: #6b6280 !important; }
body.ts-mode-light .nav-links li:hover    { background: rgba(0,0,0,0.05) !important; }
body.ts-mode-light .nav-links li.active   { color: white !important; }
body.ts-mode-light .sidebar-logo span     { color: #1a1625 !important; }
body.ts-mode-light .text-link-btn         { color: var(--accent) !important; }
body.ts-mode-light .edit-btn              { background: rgba(0,0,0,0.05) !important; border-color: rgba(0,0,0,0.1) !important; color: #1a1625 !important; }
body.ts-mode-light .back-btn              { background: rgba(0,0,0,0.05) !important; color: #1a1625 !important; }
body.ts-mode-light .icon-btn              { color: #1a1625 !important; }
body.ts-mode-light .top-bar               { background: rgba(255,255,255,0.95) !important; border-bottom: 1px solid rgba(0,0,0,0.08); }
body.ts-mode-light .bottom-nav            { background: rgba(255,255,255,0.88) !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .nav-item              { color: #6b6280 !important; }
body.ts-mode-light .nav-item.active       { color: var(--accent) !important; }
body.ts-mode-light .nav-item.create-nav   { color: #ffffff !important; }
body.ts-mode-light .brand-name            { background: var(--grad-celestial); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.ts-mode-light .profile-nav-header    { background: rgba(255,255,255,0.95) !important; border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .drawer-content        { background: #f5f4f8 !important; }
body.ts-mode-light .drawer-header         { border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .comment-box           { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; color: #1a1625 !important; }
body.ts-mode-light .comment-box::placeholder { color: #9090a8; }
body.ts-mode-light .comment-input-area    { background: rgba(0,0,0,0.02) !important; border-color: rgba(0,0,0,0.06) !important; }
body.ts-mode-light .comment-text          { color: #1a1625 !important; }
body.ts-mode-light .author-display        { color: #1a1625 !important; }
body.ts-mode-light .author-handle         { color: #6b6280 !important; }
body.ts-mode-light .post-content          { color: #1a1625 !important; }
body.ts-mode-light .post-meta             { color: #8888a8 !important; }
body.ts-mode-light .date-pill             { background: #f0eef8 !important; border-color: rgba(0,0,0,0.08) !important; color: #6b6280 !important; }
body.ts-mode-light .profile-name          { color: #1a1625 !important; }
body.ts-mode-light .profile-handle        { color: var(--accent) !important; }
body.ts-mode-light .profile-bio           { color: #4a4460 !important; }
body.ts-mode-light .stat-value            { color: #1a1625 !important; }
body.ts-mode-light .stat-label            { color: #6b6280 !important; }
body.ts-mode-light .haven-card-name       { color: #1a1625 !important; }
body.ts-mode-light .haven-card-handle     { color: var(--accent) !important; }
body.ts-mode-light .haven-card-stats      { color: #6b6280 !important; }
body.ts-mode-light .notif-text            { color: #1a1625 !important; }
body.ts-mode-light .notif-meta            { color: #6b6280 !important; }
body.ts-mode-light .modal-title           { color: #1a1625 !important; }
body.ts-mode-light .modal-subtitle        { color: #6b6280 !important; }
body.ts-mode-light .input-group input,
body.ts-mode-light .input-group textarea  { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; color: #1a1625 !important; }
body.ts-mode-light .input-group label     { color: #6b6280 !important; }
body.ts-mode-light .post-audio-player     { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .stream-btn            { color: #6b6280 !important; border-color: rgba(0,0,0,0.08) !important; }
body.ts-mode-light .stream-btn:hover      { background: rgba(0,0,0,0.05) !important; color: #1a1625 !important; }
body.ts-mode-light .track-result:hover    { background: rgba(0,0,0,0.05) !important; }
body.ts-mode-light .comment-input-area    { background: rgba(0,0,0,0.02) !important; }
body.ts-mode-light #music-modal-card      { background: #ffffff !important; }
body.ts-mode-light .haven-icon-picker-box { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .glyph-btn            { background: rgba(0,0,0,0.05) !important; border-color: rgba(0,0,0,0.1) !important; color: #4a4460 !important; }
body.ts-mode-light .glyph-btn:hover      { background: rgba(0,0,0,0.09) !important; color: #1a1625 !important; }
body.ts-mode-light .glyph-btn.active     { background: var(--accent) !important; color: white !important; border-color: transparent !important; }
body.ts-mode-light #glyph-selector,
body.ts-mode-light #edit-glyph-selector  { background: transparent !important; }
body.ts-mode-light .picker-haven-row     { color: #1a1625 !important; }
body.ts-mode-light .picker-haven-row:hover { background: rgba(0,0,0,0.05) !important; border-color: rgba(0,0,0,0.1) !important; }
body.ts-mode-light .picker-section-label { color: #6b6280 !important; }
body.ts-mode-light #haven-picker-modal .onboarding-card { background: #ffffff !important; }
body.ts-mode-light .haven-target-btn     { color: var(--accent) !important; }

body.ts-mode-midnight {
    --bg-dark: #02020a;
    --card-dark: rgba(8,8,20,0.8);
    --text-dim: #8888b0;
    --border: rgba(100,100,200,0.07);
}

body.ts-mode-dim {
    --bg-dark: #1a1a2e;
    --card-dark: rgba(26,26,50,0.8);
    --text-dim: #9090b8;
    --border: rgba(150,150,255,0.08);
}

body.ts-mode-solarized {
    --bg-dark: #002b36;
    --card-dark: rgba(0,43,54,0.9);
    --text-main: #fdf6e3;
    --text-dim: #839496;
    --border: rgba(131,148,150,0.15);
}

body.ts-mode-high-contrast {
    --bg-dark: #000000;
    --card-dark: rgba(0,0,0,0.95);
    --text-main: #ffffff;
    --text-dim: #bbbbbb;
    --border: rgba(255,255,255,0.25);
}
body.ts-mode-high-contrast .post-card { border-width: 2px !important; }



#ts-filter-overlay[data-filter="warm"] {
    background: rgba(255, 160, 30, 0.09);
    mix-blend-mode: normal;
}

#ts-filter-overlay[data-filter="cool"] {
    background: rgba(30, 100, 255, 0.08);
    mix-blend-mode: normal;
}

#ts-filter-overlay[data-filter="sepia"] {
    background: rgba(120, 70, 20, 0.15);
    mix-blend-mode: multiply;
}
body.ts-filter-sepia .post-card,
body.ts-filter-sepia .feed-composer-box,
body.ts-filter-sepia .haven-card,
body.ts-filter-sepia .auth-card,
body.ts-filter-sepia .onboarding-card {
    filter: sepia(0.4) saturate(0.85);
}

#ts-filter-overlay[data-filter="grayscale"] {
    background: transparent;
}
body.ts-filter-grayscale .post-card,
body.ts-filter-grayscale .feed-composer-box,
body.ts-filter-grayscale .haven-card,
body.ts-filter-grayscale .auth-card,
body.ts-filter-grayscale .onboarding-card,
body.ts-filter-grayscale .sidebar,
body.ts-filter-grayscale .top-bar,
body.ts-filter-grayscale .bottom-nav,
body.ts-filter-grayscale .drawer-content {
    filter: grayscale(1) !important;
}

#ts-filter-overlay[data-filter="nightvision"] {
    background: rgba(0, 100, 0, 0.14);
    mix-blend-mode: normal;
}
body.ts-filter-nightvision {
    --text-main: #80ff80;
    --text-dim: #40a040;
}

#ts-filter-overlay[data-filter="cinematic"] {
    background: transparent;
    pointer-events: none;
}
#ts-filter-overlay[data-filter="cinematic"]::before,
#ts-filter-overlay[data-filter="cinematic"]::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 10vh;
    min-height: 50px;
    background: #000;
}
#ts-filter-overlay[data-filter="cinematic"]::before { top: 0; }
#ts-filter-overlay[data-filter="cinematic"]::after  { bottom: 0; }

#ts-filter-overlay[data-filter="dreamy"] {
    background: rgba(255, 182, 193, 0.1);
    backdrop-filter: blur(1px) saturate(1.2);
}

#ts-filter-overlay[data-filter="redshift"] {
    background: rgba(220, 20, 20, 0.09);
    mix-blend-mode: normal;
}

img.emoji, img.ts-retro-emoji {
    height: 1.1em;
    width: 1.1em;
    vertical-align: -0.15em;
    object-fit: contain;
    display: inline;
    margin: 0 0.05em;
}


#emoji-picker-floating {
    position: fixed;
    z-index: 9999;
    display: none;
}

#emoji-picker-floating em-emoji-picker {
    width: 320px;
    height: 360px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);

    --em-rgb-background: 20, 19, 26;
    --em-rgb-input: 35, 34, 42;
    --em-rgb-color: 240, 237, 238;
    --em-rgb-accent: 121, 94, 170;
    --em-color-border: rgba(255,255,255,0.07);
    --em-color-border-over: rgba(121,94,170,0.5);
    --em-font-family: var(--ts-font);
    --em-font-size: 14px;
    --em-emoji-size: 22px;
    --em-emoji-padding: 5px;
    --em-category-button-size: 20px;
    --em-preview-height: 56px;
}

body.ts-mode-light #emoji-picker-floating em-emoji-picker {
    --em-rgb-background: 255, 255, 255;
    --em-rgb-input: 245, 244, 248;
    --em-rgb-color: 26, 22, 37;
    --em-color-border: rgba(0,0,0,0.08);
    --em-color-border-over: rgba(121,94,170,0.4);
}

.ts-modal-shell { border-radius: 24px; }

.ts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--card-dark);
    border-radius: 24px 24px 0 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.ts-modal-body {
    overflow-y: auto;
    padding: 20px 22px 28px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.ts-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ts-label:first-child { margin-top: 0; }

.sidebar-search-anchor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--ts-r, 12px);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sidebar-search-anchor:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-dim);
    color: var(--text-main);
}

.sidebar-search-anchor i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-search-anchor span {
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 1000px) {
    .sidebar { width: 80px; padding: 1.5rem 1rem; }
    .sidebar-logo span, .nav-links span, .sidebar-search-anchor span { display: none; }
    .sidebar-search-anchor { justify-content: center; padding: 12px; }
}