/* StoryForge Design System */
:root {
    /* Colors - Deep Cinematic Palette */
    --bg-main: #06070a;
    --bg-darker: #020305;
    --sidebar-width: 280px;
    --accent-primary: #7c4dff; /* Electric Purple */
    --accent-secondary: #00d2ff; /* Cyan Blue */
    --accent-gradient: linear-gradient(135deg, #7c4dff 0%, #00d2ff 100%);
    --glass-bg: rgba(15, 18, 26, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: rgba(124, 77, 255, 0.1);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a8b1;
    --text-muted: #64748b;
    
    /* Spacing & Borders */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .logo-text {
    font-family: 'Outfit', sans-serif;
}

/* Layout Structure */
#app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--glass-border);
    background: var(--bg-darker);
    z-index: 100;
    overflow-y: auto;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.logo-container:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.3);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo-text span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--glass-glow);
    border-left: 3px solid var(--accent-primary);
}

.create-btn {
    margin-top: 1rem;
    background: var(--accent-gradient);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

.create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.5);
}

.nav-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1rem 0;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    background: radial-gradient(circle at top right, #1a1a2e 0%, #06070a 100%);
}

#top-bar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    background: rgba(6, 7, 10, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 30px;
    width: 400px;
    border: 1px solid var(--glass-border);
}

.search-container input {
    background: none;
    border: none;
    color: white;
    font-size: 0.9rem;
    width: 100%;
}

.search-container input:focus {
    outline: none;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Glassmorphism Cards */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.container {
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* View Container with Animation */
#view-container {
    flex: 1;
    position: relative;
}

.view-enter {
    animation: fadeInUp 0.5s forwards ease-out;
}

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

/* Feed Grid */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.story-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.story-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.story-cover {
    height: 200px;
    position: relative;
}

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

.category-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.story-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.story-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.story-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.story-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.hero-banner .detail-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.story-synopsis {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
}

.progress-container {
    margin-top: auto;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
}

.story-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.story-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Filters */
.filters-section {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 10px;
}

.filter-chip {
    padding: 8px 18px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
    font-size: 0.85rem;
    font-weight: 500;
}

.filter-chip:hover, .filter-chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Project Detail View */
.detail-view {
    padding-bottom: 100px;
}

.hero-banner {
    height: 350px;
    width: 100%;
    position: relative;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.hero-banner > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg-main) 0%, rgba(6, 7, 10, 0.4) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 3rem;
}

/* Timeline */
.timeline-section {
    margin: 3rem 0;
}

.timeline-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 2rem 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--glass-border);
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 60px;
}

.node-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-darker);
    border: 2px solid var(--text-muted);
    transition: var(--transition-smooth);
}

.timeline-node.active .node-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.timeline-node.completed .node-dot {
    background: #4caf50;
    border-color: #4caf50;
}

.node-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    width: 400px;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

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

/* Loader */
.view-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
}

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

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

/* -- TABLET (768px - 1023px): icon-only sidebar ------------------------- */
@media (max-width: 1023px) and (min-width: 768px) {
    .sidebar {
        width: 72px;
        padding: 1.5rem 0.5rem;
    }
    .logo-text,
    .nav-item span,
    .user-info,
    .sidebar-footer {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    .logo-container {
        justify-content: center;
        margin-bottom: 2rem;
    }
    .search-container {
        width: 240px;
    }
}
/* Authentication Styles */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999 !important;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(124, 77, 255, 0.15) 0%, #06070a 80%);
    transition: var(--transition-smooth);
    overflow-y: auto;
    padding: 2rem 1rem;
}

.auth-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

.auth-card {
    width: min(550px, 100%);
    padding: 3.5rem 3rem;
    border-radius: 30px;
    text-align: center;
    animation: authCardEnter 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    transform: scale(1);
    opacity: 1;
    flex-shrink: 0;
    background: rgba(10, 12, 16, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(124, 77, 255, 0.1) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 2.5rem;
}

.auth-logo .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
}

.auth-logo h1 {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 5px;
    margin-bottom: 0;
    font-weight: 400;
    opacity: 0.9;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 12px;
    margin-bottom: 2rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 8px; /* For scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.avatar-grid::-webkit-scrollbar {
    width: 6px;
}
.avatar-grid::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: 10px;
}

.avatar-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2px;
    background: rgba(255, 255, 255, 0.03);
}

.avatar-item img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-item:hover {
    transform: translateY(-4px) scale(1.08);
    border-color: rgba(124, 77, 255, 0.4);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.avatar-item.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.4);
    transform: translateY(-4px) scale(1.08);
    background: rgba(124, 77, 255, 0.1);
}

.auth-field {
    margin-bottom: 1.5rem;
    text-align: left;
}

.auth-field label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.auth-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1.05rem;
    transition: var(--transition-smooth);
}

.auth-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.2);
}

.auth-input.invalid {
    border-color: rgba(255, 61, 113, 0.5);
}

.error-hint {
    font-size: 0.7rem;
    color: #ff3d71;
    margin-top: 6px;
    opacity: 0;
    transition: var(--transition-smooth);
}

.auth-input.invalid + .error-hint {
    opacity: 1;
}

.auth-button {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

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

.auth-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 77, 255, 0.6);
}

/* Layout Utilities */
.hidden {
    display: none !important;
}

.blurred-bg {
    filter: blur(20px);
    opacity: 0.5;
    pointer-events: none;
}

/* Emergency UI */
#auth-root {
    width: 100%;
    min-height: 100vh;
}

.fallback-ui {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #ff4d4d;
    font-family: inherit;
    text-align: center;
    z-index: 10001;
    padding: 2rem;
}


.fallback-ui h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* ===========================================================================
   MOBILE RESPONSIVE SYSTEM  (max-width: 767px)
   =========================================================================== */

/* -- Global overflow guard ----------------------------------------------- */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

*, *::before, *::after {
    box-sizing: border-box;
    min-width: 0; /* prevents flex/grid children from overflowing */
}

@media (max-width: 767px) {

    /* -- 1. SIDEBAR  hidden on mobile (replaced by bottom nav) ----------- */
    .sidebar {
        /* Collapse to bottom fixed nav */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100% !important;
        height: 64px;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        padding: 0 8px;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        background: rgba(2, 3, 5, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 200;
        overflow: visible;
    }

    /* Hide sidebar elements that don't belong in bottom nav */
    .logo-container,
    .sidebar-footer,
    .nav-divider,
    .nav-item span,
    .user-info {
        display: none !important;
    }

    /* Nav menu: horizontal row */
    .nav-menu {
        flex-direction: row;
        flex: 1;
        justify-content: space-around;
        align-items: center;
        gap: 0;
    }

    /* Nav items: icon-only, vertically centred */
    .nav-item {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 8px 12px;
        gap: 2px;
        border-radius: var(--radius-sm);
        min-width: 48px;
        font-size: 0.6rem;
        border-left: none !important;
    }

    .nav-item.active {
        background: var(--glass-glow);
        border-bottom: 2px solid var(--accent-primary);
        border-left: none;
    }

    .nav-item i {
        width: 22px;
        height: 22px;
    }

    /* "New Project" create-btn: hide from bottom nav, shown as FAB instead */
    .nav-item.create-btn {
        display: none !important;
    }

    /* -- 2. FLOATING ACTION BUTTON (FAB) for New Project ------------------ */
    #mobile-fab {
        display: flex !important; /* override inline display:none on mobile */
        position: fixed;
        bottom: 76px; /* just above the bottom nav */
        right: 20px;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--accent-gradient);
        border: none;
        color: white;
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
        z-index: 201;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 20px rgba(124, 77, 255, 0.6);
        transition: var(--transition-smooth);
    }

    #mobile-fab:hover,
    #mobile-fab:active {
        transform: scale(1.1);
        box-shadow: 0 6px 28px rgba(124, 77, 255, 0.8);
    }

    /* -- 3. MAIN CONTENT: push up above bottom nav ------------------------- */
    #app-container {
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
    }

    #main-content {
        width: 100%;
        overflow-x: hidden;
        padding-bottom: 72px; /* clear the bottom nav */
    }

    /* -- 4. TOP BAR / HEADER ----------------------------------------------- */
    #top-bar {
        height: auto;
        padding: 10px 16px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .search-container {
        width: 100%;
        order: 2;
        flex: 1 1 100%;
        padding: 8px 14px;
    }

    .header-actions {
        order: 1;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* -- 5. CONTAINER PADDING ---------------------------------------------- */
    .container {
        padding: 1.25rem 1rem;
    }

    /* -- 6. FILTER CHIPS --------------------------------------------------- */
    .filters-section {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;       /* Firefox */
        padding-bottom: 8px;
        gap: 8px;
        margin-bottom: 1.25rem;
    }

    .filters-section::-webkit-scrollbar {
        display: none;               /* Chrome/Safari */
    }

    .filter-chip {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    /* -- 7. FEED GRID: single column --------------------------------------- */
    .feed-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .story-card {
        width: 100%;
    }

    /* -- 8. PROJECT DETAIL PAGE -------------------------------------------- */
    /* Stack the 2-column grid to 1 column */
    .detail-view .container > div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    /* Hero banner shorter on mobile */
    .hero-banner {
        height: 220px;
    }

    .hero-overlay {
        padding: 1.5rem;
    }

    .hero-overlay h1 {
        font-size: 1.8rem !important;
    }

    /* Sidebar panel (opportunities) below main content */
    .detail-view aside {
        width: 100% !important;
    }

    .detail-view aside > div {
        position: static !important; /* remove sticky positioning */
    }

    /* Full-span comments section already uses grid-column:1/-1, fine on mobile */
    .detail-view section[style*="grid-column"] {
        width: 100% !important;
    }

    /* -- 9. TIMELINE: allow horizontal scroll on mobile -------------------- */
    .timeline-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        gap: 1.5rem;
        padding: 2rem 1rem;
        scrollbar-width: none;
    }

    .timeline-container::-webkit-scrollbar {
        display: none;
    }

    /* -- 10. COMMENTS ------------------------------------------------------ */
    /* Comment avatars stay small, text wraps cleanly */
    #view-container [id^="comment-list"] > div {
        flex-wrap: nowrap;
    }

    #view-container textarea {
        font-size: 16px; /* prevents iOS auto-zoom on input focus */
    }

    /* -- 11. MODAL --------------------------------------------------------- */
    .modal-card {
        width: calc(100% - 2rem);
        padding: 1.75rem;
        margin: 0 1rem;
    }

    /* -- 12. AUTH SCREEN --------------------------------------------------- */
    .auth-card {
        padding: 2rem 1.25rem;
    }

    .avatar-item {
        width: 60px;
        height: 60px;
    }

    /* -- 13. TOAST: clear the bottom nav ----------------------------------- */
    /* JS sets bottom:30px; CSS overrides it on mobile */
    body > div.glass[style*="position: fixed"][style*="bottom"] {
        bottom: 80px !important;
        right: 16px !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
    }

    /* -- 14. PROFILE / SETTINGS: reasonable padding ----------------------- */
    .glass[style*="padding: 3rem"] {
        padding: 1.5rem !important;
    }
}
