/* ==========================================================================
   Modular UI Components: Discover, Profiles, Notifications, Settings, Modals, Toasts
   Linear / Slack Dark Theme System
   ========================================================================== */

/* Page View Container */
.page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: var(--space-32);
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-24);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

/* --------------------------------------------------------------------------
   4. Discover People — Maximalist Radiant Gradient Profile Card
   -------------------------------------------------------------------------- */
.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.user-card {
    border-radius: 32px;
    padding: 24px 22px 22px 22px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 250ms cubic-bezier(0.16, 1, 0.3, 1),
                border-color 250ms cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Dark / AMOLED: Maximalist Multi-Stop Gradient Mesh with Chromatic Glow */
    background: radial-gradient(circle at 85% 15%, rgba(236, 72, 153, 0.22) 0%, transparent 48%),
                radial-gradient(circle at 15% 85%, rgba(6, 182, 212, 0.2) 0%, transparent 48%),
                radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
                linear-gradient(165deg, #0e1526 0%, #090d18 55%, #050811 100%);
    border: 1.5px solid rgba(139, 92, 246, 0.38);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.85), 0 0 24px rgba(139, 92, 246, 0.18);
}

/* Light Theme: Holographic Aurora Maximalist Gradient */
[data-theme="light"] .user-card {
    background: radial-gradient(circle at 85% 15%, rgba(244, 114, 182, 0.28) 0%, transparent 48%),
                radial-gradient(circle at 15% 85%, rgba(56, 189, 248, 0.28) 0%, transparent 48%),
                radial-gradient(circle at 50% 50%, rgba(192, 132, 252, 0.18) 0%, transparent 60%),
                linear-gradient(165deg, #FFFFFF 0%, #F5F3FF 45%, #E0F2FE 100%);
    border: 1.5px solid rgba(192, 132, 252, 0.6);
    box-shadow: 0 20px 48px rgba(192, 132, 252, 0.25), 0 4px 16px rgba(56, 189, 248, 0.15);
}

.user-card:hover {
    transform: translateY(-6px);
    border-color: rgba(236, 72, 153, 0.65);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(236, 72, 153, 0.28);
}
[data-theme="light"] .user-card:hover {
    border-color: rgba(219, 39, 119, 0.8);
    box-shadow: 0 26px 56px rgba(192, 132, 252, 0.45), 0 8px 24px rgba(236, 72, 153, 0.2);
}

/* Top Row: Avatar on Left, Share on Right */
.user-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.user-card-avatar-wrap {
    position: relative;
    width: 66px;
    height: 66px;
}

.user-card-avatar {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.9);
    overflow: hidden;
}
[data-theme="light"] .user-card-avatar {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    color: #ffffff;
    border: 2px solid #FFFFFF;
    box-shadow: 0 6px 18px rgba(129, 140, 248, 0.35);
}

.user-card-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10B981;
    border: 2.5px solid #070B14;
    box-shadow: 0 0 10px #10B981;
}
[data-theme="light"] .user-card-online-dot {
    border-color: #FFFFFF;
}

/* Sleek Top-Right Share Button */
.user-card-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 180ms ease;
    backdrop-filter: blur(8px);
}
.user-card-share-btn:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(139, 92, 246, 0.3));
    border-color: rgba(139, 92, 246, 0.6);
    transform: scale(1.12);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}
[data-theme="light"] .user-card-share-btn {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
    color: #334155;
}
[data-theme="light"] .user-card-share-btn:hover {
    background: #ffffff;
    color: #7c3aed;
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.2);
}

/* User Identity Stack */
.user-card-identity {
    margin-top: 18px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-card-name {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(90deg, #FFFFFF 0%, #E0E7FF 50%, #DDD6FE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.25;
}
[data-theme="light"] .user-card-name {
    background: linear-gradient(90deg, #0F172A 0%, #312E81 60%, #4338CA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-card-title {
    font-size: 13.5px;
    font-weight: 500;
    color: #94A3B8;
}
[data-theme="light"] .user-card-title {
    color: #64748B;
}

/* Maximalist Radiant Pill Tags */
.user-card-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.user-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(139, 92, 246, 0.15));
    color: #C4B5FD;
    border: 1px solid rgba(139, 92, 246, 0.4);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}
[data-theme="light"] .user-card-tag {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.12), rgba(168, 85, 247, 0.12));
    color: #6D28D9;
    border: 1px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.1);
}

/* 3-Column Metrics Row: Stories, Messengers, Status */
.user-card-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    backdrop-filter: blur(10px);
}
[data-theme="light"] .user-card-metrics {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 4px 14px rgba(192, 132, 252, 0.12);
}

.user-metric-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    text-align: center;
}

.metric-val {
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #38BDF8 0%, #A855F7 60%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="light"] .metric-val {
    background: linear-gradient(135deg, #0284C7 0%, #7C3AED 60%, #DB2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
[data-theme="light"] .metric-lbl {
    color: #64748B;
}

.metric-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 4px;
    flex-shrink: 0;
}
[data-theme="light"] .metric-divider {
    background: rgba(0, 0, 0, 0.08);
}

/* Bottom Action Row: View Profile + Message Buttons */
.user-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

/* Secondary / Follow Action Button */
.user-card-follow-btn,
.user-card-view-btn {
    flex: 1;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 180ms ease;
    user-select: none;
    
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(139, 92, 246, 0.5);
    color: #F1F5F9;
    backdrop-filter: blur(14px);
}
.user-card-follow-btn:hover,
.user-card-view-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.85);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}
.user-card-follow-btn.following {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.65);
    color: #34D399;
}
.user-card-follow-btn.following:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.65);
    color: #F87171;
}

[data-theme="light"] .user-card-follow-btn,
[data-theme="light"] .user-card-view-btn {
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(139, 92, 246, 0.35);
    color: #1E293B;
}
[data-theme="light"] .user-card-follow-btn:hover,
[data-theme="light"] .user-card-view-btn:hover {
    background: #FFFFFF;
    border-color: #7C3AED;
    color: #7C3AED;
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.2);
}
[data-theme="light"] .user-card-follow-btn.following {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.5);
    color: #059669;
}
[data-theme="light"] .user-card-follow-btn.following:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.5);
    color: #DC2626;
}

/* Primary Maximalist Gradient Button ("Message") */
.user-card-primary-btn {
    flex: 1;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 180ms ease;
    border: none;
    outline: none;
    user-select: none;
    
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 50%, #DB2777 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45);
}
.user-card-primary-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 26px rgba(219, 39, 119, 0.55);
    filter: brightness(1.1);
}
[data-theme="light"] .user-card-primary-btn {
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 50%, #EC4899 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}
[data-theme="light"] .user-card-primary-btn:hover {
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.45);
}

.user-card .btn-connect {
    width: 100%;
    background: var(--grad-brand);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: transform var(--ease-normal), box-shadow var(--ease-normal);
}
.user-card .btn-connect:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   5. Profile View (240px Banner, 112px Avatar, Stats Row)
   -------------------------------------------------------------------------- */
.profile-hero {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-24);
    box-shadow: var(--shadow-card);
}

.profile-cover {
    height: 240px;
    background: var(--grad-banner);
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: var(--space-16);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.3s ease;
}

.btn-change-cover {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-change-cover:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

.profile-meta-wrap {
    padding: var(--space-24) var(--space-32) var(--space-32) var(--space-32);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.profile-avatar-row {
    margin-top: -80px; /* 112px avatar overlaps by 40px */
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.profile-avatar-lg {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 4px solid var(--bg-surface);
    background: var(--grad-avatar);
    color: #ffffff;
    font-size: 38px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
    position: relative;
}

.profile-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
}

.profile-avatar-lg:hover .avatar-upload-overlay {
    opacity: 1;
}

.edit-pfp-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 6px;
}

.edit-pfp-preview {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 3px solid var(--border);
    background: var(--grad-avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
}

.edit-pfp-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.edit-cover-preview {
    width: 100%;
    height: 96px;
    border-radius: var(--radius-md);
    background: var(--grad-banner);
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.cover-preset-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.cover-preset-chip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.cover-preset-chip:hover {
    transform: scale(1.15);
}

.cover-preset-chip.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--accent);
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.profile-handle {
    font-size: 14px;
    color: var(--text-muted);
}

.profile-bio {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 640px;
}

/* Stats Row: Posts, Followers, Following */
.profile-stats-row {
    display: flex;
    gap: var(--space-32);
    padding: var(--space-16) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.profile-stat-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.profile-stat-box.interactive {
    cursor: pointer;
    padding: 6px 14px;
    margin: -6px -14px;
    border-radius: var(--radius-md);
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}
.profile-stat-box.interactive:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.profile-stat-box.interactive:hover .profile-stat-number {
    color: var(--accent);
}
.profile-stat-box.interactive:hover .profile-stat-label {
    color: var(--text-primary);
}
.profile-stat-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 180ms ease;
}
.profile-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: color 180ms ease;
}

/* --------------------------------------------------------------------------
   Follow Requests & Follow Back System
   -------------------------------------------------------------------------- */
.follow-requests-card {
    background: var(--bg-surface);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: var(--radius-lg);
    padding: var(--space-16) var(--space-20);
    margin-bottom: var(--space-20);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(139, 92, 246, 0.12);
}
[data-theme="light"] .follow-requests-card {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
}

.follow-requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.req-count-badge {
    background: var(--accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.follow-requests-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.follow-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 4px;
}

.follow-request-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.follow-request-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.follow-request-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.follow-request-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-request-handle {
    font-size: 12px;
    color: var(--text-muted);
}

.follow-request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* On-the-spot Follow Back Suggestion Banner */
.follow-back-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    width: 100%;
    animation: fadeInSlide 200ms ease;
}

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

.follow-back-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.follow-back-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Followers / Following Modal List */
.follow-modal-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 420px;
}

.follow-modal-search {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    width: 100%;
}
.follow-modal-search:focus {
    border-color: var(--accent);
}

.follow-modal-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 350px;
    padding-right: 4px;
}

.follow-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    border-radius: var(--radius-md);
    transition: background 150ms ease;
    gap: 12px;
}
.follow-modal-item:hover {
    background: var(--bg-hover);
}

.follow-modal-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.follow-modal-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.follow-modal-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.follow-modal-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-modal-handle {
    font-size: 12px;
    color: var(--text-muted);
}

.follow-modal-bio {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
    margin-top: 1px;
}

.follow-modal-btn {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   6. Settings View (Grouped Cards, Section Headings, 44x24 Toggle Pill)
   -------------------------------------------------------------------------- */
.settings-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    margin-bottom: var(--space-24);
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    box-shadow: var(--shadow-card);
}

.section-heading {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: var(--space-8);
}
.section-heading.appearance {
    color: var(--accent);
}
.section-heading.privacy {
    color: var(--success);
}
.section-heading.notifications {
    color: var(--accent-violet);
}
.section-heading.account {
    color: var(--text-secondary);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-8) 0;
    border-bottom: 1px solid var(--border);
}
.settings-row:last-child {
    border-bottom: none;
}

.settings-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.settings-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.settings-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Policy Rule Indicator (Permanent Enforcement, Non-toggleable) */
.policy-rule-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.policy-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    user-select: none;
}

/* 44px wide, 24px tall Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    transition: 200ms ease;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: 200ms ease;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--grad-brand);
    border-color: transparent;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* --------------------------------------------------------------------------
   7. Notifications View
   -------------------------------------------------------------------------- */
.notif-list {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.notif-item {
    display: flex;
    align-items: center;
    gap: var(--space-16);
    padding: var(--space-16);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: background var(--ease-normal);
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item:hover {
    background: rgba(26, 36, 56, 0.5);
}
[data-theme="light"] .notif-item:hover {
    background: rgba(238, 242, 248, 0.6);
}

/* Unread Notification: tinted with --grad-surface and 3px blue dot */
.notif-item.unread {
    background: var(--grad-surface);
}
.notif-item.unread::before {
    content: "";
    position: absolute;
    left: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

/* 32px Gradient Circle Icon */
.notif-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.notif-icon-circle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.notif-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

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

/* --------------------------------------------------------------------------
   Modals & Toasts
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 11, 20, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-16);
    animation: fadeIn var(--ease-normal) forwards;
}

.modal-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: var(--space-20) var(--space-24);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-24);
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    overflow-y: auto;
    max-height: 70vh;
}

.modal-footer {
    padding: var(--space-16) var(--space-24);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-12);
    background: var(--bg-surface);
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-elevated);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: slideUp 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }

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

/* ==========================================================================
   Command Palette Spotlight (Ctrl + K) & Flowy UI Architecture
   ========================================================================== */
.palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14vh;
    animation: fadeIn 150ms ease-out;
}
.palette-overlay.closing {
    animation: fadeOut 140ms ease-in forwards;
}

.palette-card {
    width: 92%;
    max-width: 620px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 32px rgba(124, 58, 237, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: paletteSlideDown 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes paletteSlideDown {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: relative;
    background: var(--bg-surface);
}

.palette-search-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}
.palette-input::placeholder {
    color: var(--text-muted);
}

.palette-kbd {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
}

.palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.palette-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 120ms ease;
    user-select: none;
}
.palette-item:hover,
.palette-item.active {
    background: var(--bg-surface-2);
    transform: translateX(3px);
}
.palette-item.active .palette-item-title {
    color: var(--accent);
}

.palette-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--grad-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.palette-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.palette-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 120ms ease;
}

.palette-item-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.palette-item-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
    flex-shrink: 0;
}

.palette-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
}
.palette-footer kbd {
    background: var(--bg-surface-2);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Ambient Aurora Glow in Backdrop */
#app::before {
    content: '';
    position: absolute;
    top: -15%;
    left: 20%;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(59, 130, 246, 0.08) 50%, transparent 70%);
    filter: blur(110px);
    pointer-events: none;
    z-index: 1;
    animation: auroraFloat1 24s ease-in-out infinite alternate;
}

#app::after {
    content: '';
    position: absolute;
    bottom: -15%;
    right: 15%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(139, 92, 246, 0.06) 50%, transparent 70%);
    filter: blur(120px);
    pointer-events: none;
    z-index: 1;
    animation: auroraFloat2 28s ease-in-out infinite alternate;
}

@keyframes auroraFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
    100% { transform: translate(-40px, 70px) scale(0.95); }
}

@keyframes auroraFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -40px) scale(1.08); }
    100% { transform: translate(30px, -60px) scale(0.92); }
}

/* ==========================================================================
   Dynamic In-App Message Popup Notifications (Cross-Tab Alert System)
   ========================================================================== */
#inapp-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10001;
    pointer-events: none;
    max-width: 360px;
    width: calc(100vw - 40px);
}

.inapp-msg-popup {
    pointer-events: auto;
    background: rgba(18, 22, 34, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.25);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideInRight 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    user-select: none;
}

[data-theme="light"] .inapp-msg-popup {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.inapp-msg-popup:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: var(--accent);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(124, 58, 237, 0.35);
}

.inapp-msg-popup.dismissing {
    animation: slideOutRight 200ms ease-in forwards;
}

.inapp-msg-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.inapp-msg-avatar-initial {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

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

.inapp-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.inapp-msg-sender {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inapp-msg-tag {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.inapp-msg-body {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inapp-msg-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 150ms ease, background 150ms ease;
}

.inapp-msg-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(60px) scale(0.92);
    }
}
