/* =========================================
   THREDOPS GLOBAL STYLESHEET
   ========================================= */

/* 1. BASE & TYPOGRAPHY */
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; 
    background: #f4f5f7; 
    padding: 40px; 
    margin: 0; 
    color: #111; 
}
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}
h1 { 
    font-size: 2.5rem; 
    margin-bottom: 5px; 
    font-weight: 800; 
    letter-spacing: -0.02em; 
}
h2 { 
    font-size: 1.8rem; 
    margin-top: 40px; 
    margin-bottom: 10px; 
    border-top: 2px solid #eaeaea; 
    padding-top: 40px; 
}
.subtitle { 
    color: #64748b; 
    margin-bottom: 40px; 
    font-size: 1.1rem; 
}

/* 2. UNIVERSAL NAVIGATION (THREDOPS BRANDING) */
.nav-bar { 
    margin-bottom: 40px; 
    display: grid; 
    grid-template-columns: 1fr auto 1fr; 
    align-items: center; 
    background: #fff; 
    padding: 12px 25px; 
    border-radius: 12px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.02); 
    border: 1px solid #eee; 
    gap: 15px;
}

@media (max-width: 1024px) {
    .nav-bar { display: flex; flex-wrap: wrap; justify-content: center; }
}

.brand-group { display: flex; align-items: center; gap: 12px; text-decoration: none; justify-self: start; }
.logo-box { background: #0f172a; color: #fff; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; font-family: monospace; }
.brand-name { font-weight: 800; font-size: 1.3rem; color: #0f172a; letter-spacing: -0.03em; }
.brand-name span { color: #3b82f6; }

.nav-links-group { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    justify-content: center; 
    justify-self: center;
}
.nav-links-group a { text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; transition: 0.2s; color: #475569; }
.nav-links-group a:hover { background: #f1f5f9; color: #0f172a; }
.nav-links-group .nav-active { background: #0f172a; color: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
    justify-self: end;
}

.ai-persona-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #475569;
    max-width: 160px;
}
.ai-persona-pill span:last-child {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    background: #fff; 
    padding: 4px 14px 4px 4px; 
    border-radius: 30px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.user-badge img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); object-fit: cover; }
.user-handle { font-size: 0.9rem; font-weight: 700; color: #0f172a; }

/* 3. UNIVERSAL UI ELEMENTS (CARDS & BUTTONS) */
.card, .workspace-card, .settings-card, .kpi-card, .chart-container, .table-container { 
    background: #fff; 
    border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
    border: 1px solid #f1f5f9; 
    position: relative;
}
.card-title, .kpi-title { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin-bottom: 20px; }

.action-btn { background: #3b82f6; color: #fff; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 1rem; transition: 0.2s; text-decoration: none; text-align: center;}
.action-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-success { background: #10b981; }
.btn-danger { background: #ef4444; }
.btn-warning { background: #f59e0b; color: #fff; }

/* 4. COMMAND CENTRE (DASHBOARD) SPECIFIC */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; }
.kpi-card { padding: 30px; }
.kpi-title { font-size: 0.95rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.kpi-value { font-size: 3rem; font-weight: 800; color: #0f172a; line-height: 1; }

.chart-container { padding: 30px; margin-bottom: 40px; height: 350px; }
.table-container { overflow: hidden; padding: 0; }

.table-header { display: grid; grid-template-columns: 3fr 2fr 1fr; padding: 20px 25px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-weight: 700; color: #475569; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.post-row { display: grid; grid-template-columns: 3fr 2fr 1fr; padding: 25px; border-bottom: 1px solid #f1f5f9; align-items: center; transition: 0.2s; }
.post-row:hover { background: #f8fafc; }
.post-row:last-child { border-bottom: none; }
.post-hook { font-weight: 600; font-size: 1.05rem; color: #0f172a; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-date { font-size: 0.85rem; color: #94a3b8; }

.metrics-flex { display: flex; gap: 12px; flex-wrap: wrap; }
.metric-pill { display: flex; align-items: center; gap: 6px; background: #f1f5f9; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; color: #475569; }
.metric-pill.views { background: #e0f2fe; color: #0369a1; }
.metric-pill.likes { background: #fce7f3; color: #be185d; }
.metric-pill.replies { background: #fef3c7; color: #b45309; }

.eng-badge { padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 1rem; text-align: center; display: inline-block; }
.eng-high { background: #dcfce7; color: #166534; }
.eng-med { background: #fef3c7; color: #b45309; }
.eng-low { background: #f1f5f9; color: #64748b; }

.sync-badge { background: #e2e8f0; color: #475569; padding: 10px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; display: flex; align-items: center; gap: 8px; border: 1px solid #cbd5e1; }
.sync-dot { display: inline-block; width: 8px; height: 8px; background: #10b981; border-radius: 50%; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

/* 5. GLOBAL QUICK DRAFT WIDGET */
.fab-quick-draft {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0f172a;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: 0.3s;
    border: 2px solid #fff;
}
.fab-quick-draft:hover {
    transform: translateY(-5px) scale(1.05);
    background: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}
.global-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.global-modal {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid #e2e8f0;
}

/* 6. QUEUE & DRAFTS LIST ITEMS (Shared) */
.queue-container { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f1f5f9; overflow: hidden; margin-bottom: 40px; }
.queue-item { padding: 20px; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; gap: 20px; transition: transform 0.1s, box-shadow 0.1s; }
.post-content-wrapper { flex: 1; }
.post-text { font-size: 1rem; color: #0f172a; white-space: pre-wrap; margin: 0 0 10px 0; line-height: 1.4; }
.post-meta { font-size: 0.85rem; color: #64748b; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge { padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.75rem; text-transform: uppercase; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-published { background: #dcfce7; color: #166534; }
.status-failed { background: #fee2e2; color: #b91c1c; }
.status-draft { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.cat-badge { padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.75rem; text-transform: uppercase; background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; display: inline-block; } 
.cat-General { background: #e2e8f0; color: #475569; border-color: transparent; }
.cat-Thought-Leadership { background: #dbeafe; color: #1e40af; border-color: transparent; }
.cat-News-Updates { background: #ffedd5; color: #c2410c; border-color: transparent; }
.cat-Promo-Offer { background: #fce7f3; color: #be185d; border-color: transparent; }
.cat-Personal-Story { background: #f3e8ff; color: #7e22ce; border-color: transparent; }
.delete-btn { background: #ef4444; color: white; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 0.85rem; }
.delete-btn:hover { background: #dc2626; }
.edit-btn { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 0.85rem; transition: 0.2s; }
.edit-btn:hover { background: #e2e8f0; color: #0f172a; }
.section-title { font-size: 1.2rem; color: #0f172a; margin-bottom: 25px; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; }
.empty-state { padding: 30px; text-align: center; color: #94a3b8; }

/* 7. QUEUE TOGGLE & WEEK VIEW */
.view-toggle { display: inline-flex; background: #e2e8f0; border-radius: 8px; padding: 4px; }
.view-btn { padding: 6px 16px; border: none; background: transparent; border-radius: 6px; cursor: pointer; font-weight: bold; color: #64748b; transition: 0.2s; font-size: 0.9rem; }
.view-btn.active { background: #fff; color: #0f172a; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 15px; padding-bottom: 15px; min-width: 1000px; }
.day-column { background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; overflow: hidden; }
.day-header { padding: 12px 10px; text-align: center; border-bottom: 1px solid #e2e8f0; font-weight: bold; color: #0f172a; background: #f1f5f9; font-size: 0.95rem; }
.week-dropzone { padding: 10px; min-height: 60px; border-bottom: 1px dashed #e2e8f0; display: flex; flex-direction: column; gap: 8px; }
.week-dropzone:last-child { border-bottom: none; }

.week-item { background: #fff; border: 1px solid #cbd5e1; padding: 12px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.2s; position: relative; }
.week-item:hover { border-color: #3b82f6; box-shadow: 0 4px 8px rgba(59, 130, 246, 0.1); }
.week-item .drag-handle-mini { position: absolute; top: 10px; right: 10px; color: #cbd5e1; cursor: grab; font-size: 1rem; }
.week-item .drag-handle-mini:hover { color: #3b82f6; }

.week-empty-slot { background: transparent; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 10px; text-align: center; color: #64748b; font-size: 0.85rem; font-weight: bold; cursor: pointer; transition: 0.2s; }
.week-empty-slot:hover { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; }

/* =========================================
   8. NEW SAAS LAYOUT (SIDEBAR NAVIGATION)
   ========================================= */
body.app-body { padding: 0; background: #f8fafc; height: 100vh; overflow: hidden; display: flex; }

.sidebar-nav {
    width: 260px;
    background: #0f172a;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    transition: 0.3s;
}

.sidebar-header { padding: 25px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 15px; }
.sidebar-header .brand-name { color: #fff; font-size: 1.4rem; }

.sidebar-menu { flex: 1; overflow-y: auto; padding: 0 15px; display: flex; flex-direction: column; gap: 5px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px;
    color: #cbd5e1; text-decoration: none; border-radius: 8px;
    font-weight: 600; font-size: 0.95rem; transition: 0.2s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-link.active { background: #3b82f6; color: #fff; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }

.sidebar-footer { padding: 20px 15px; border-top: 1px solid rgba(255,255,255,0.05); }

.main-workspace {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* =========================================
   9. SETTINGS TAB LAYOUT
   ========================================= */
.settings-layout { display: flex; gap: 30px; max-width: 1000px; align-items: flex-start; }
.settings-menu { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 5px; }

.settings-tab-btn {
    text-align: left; background: transparent; border: none; padding: 12px 15px;
    font-size: 0.95rem; font-weight: bold; color: #64748b; border-radius: 8px;
    cursor: pointer; transition: 0.2s;
}
.settings-tab-btn:hover { background: #e2e8f0; color: #0f172a; }
.settings-tab-btn.active { background: #fff; color: #3b82f6; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.settings-content-area { flex: 1; min-width: 0; }
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }

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

/* Danger Zone */
.danger-zone { border: 1px solid #fecaca; background: #fff5f5; padding: 20px; border-radius: 12px; margin-top: 30px; }

/* ========================================= */
/* THREDOPS HOMEPAGE & SAAS OVERRIDES        */
/* ========================================= */

/* The Energetic CTA Button */
.btn-primary { background: #3b82f6; color: white; padding: 16px 32px; border-radius: 8px; font-weight: 700; text-decoration: none; transition: 0.2s; display: inline-block; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); border: none; }
.btn-primary:hover { background: #2563eb; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4); }

.hero-section { position: relative; max-width: 950px; margin: 120px auto 80px; text-align: center; padding: 0 20px; z-index: 1; }
.hero-headline { font-size: 5rem; color: #0f172a; margin-bottom: 24px; line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; } 
.hero-sub { font-size: 1.25rem; color: #475569; line-height: 1.6; max-width: 700px; margin: 0 auto 40px; font-weight: 400; }
.trust-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; color: #475569; font-weight: 600; margin-top: 35px; background: #ffffff; padding: 10px 20px; border-radius: 30px; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }

.floating-pill { position: absolute; background: white; border: 1px solid #e2e8f0; padding: 12px 20px; border-radius: 30px; box-shadow: 0 15px 35px rgba(15, 23, 42, 0.05); font-size: 0.95rem; font-weight: 600; color: #475569; display: flex; align-items: center; gap: 10px; animation: float-animation 6s ease-in-out infinite; z-index: -1; opacity: 0.9; white-space: nowrap; }
@keyframes float-animation { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }
.pill-1 { top: 10%; left: -5%; animation-delay: 0s; }
.pill-2 { top: 60%; right: -10%; animation-delay: 2s; }
.pill-3 { bottom: -15%; left: 10%; animation-delay: 4s; }
.pill-4 { top: 5%; right: 0%; animation-delay: 1.5s; }

.feature-section { padding: 60px 20px; max-width: 1200px; margin: 0 auto; }
.zig-zag-row { display: flex; align-items: center; gap: 80px; margin-bottom: 120px; }
.zig-zag-row.reverse { flex-direction: row-reverse; }
.feature-text { flex: 1; }
.feature-text h2 { font-size: 2.4rem; font-weight: 800; line-height: 1.15; margin-bottom: 20px; color: #0f172a; border: none; padding: 0; letter-spacing: -0.03em; }
.feature-text p { font-size: 1.1rem; color: #475569; line-height: 1.7; margin-bottom: 25px; font-weight: 400; }

.feature-image-wrapper { flex: 1; position: relative; }
.feature-mockup { width: 100%; border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; background: #fff; padding: 25px; box-sizing: border-box; position: relative; overflow: hidden; }

.toolkit-section { background: #ffffff; padding: 100px 20px; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }
.toolkit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; max-width: 1000px; margin: 60px auto 0; }
.toolkit-card { background: #f8fafc; padding: 35px; border-radius: 12px; border: 1px solid #e2e8f0; transition: 0.3s; }
.toolkit-card:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.05); background: #ffffff; }
.toolkit-icon { font-size: 1.8rem; margin-bottom: 15px; display: inline-block; background: #eff6ff; width: 50px; height: 50px; line-height: 50px; text-align: center; border-radius: 10px; border: 1px solid #bfdbfe; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; max-width: 1200px; margin: 60px auto 40px; padding: 0 20px; }
.pricing-card { background: white; padding: 40px 30px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 10px 25px rgba(0,0,0,0.02); transition: 0.3s; display: flex; flex-direction: column; }
.pricing-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); border-color: #cbd5e1; }
.pricing-card.popular { border: 2px solid #3b82f6; position: relative; }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #3b82f6; color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }

.tier-name { font-size: 1.3rem; font-weight: 800; color: #0f172a; margin: 0 0 10px 0; }
.tier-price { font-size: 3rem; font-weight: 800; color: #0f172a; margin-bottom: 5px; line-height: 1; letter-spacing: -0.04em; }
.tier-sub { font-size: 0.95rem; color: #64748b; margin-bottom: 30px; }

.features-list { list-style: none; padding: 0; margin: 0 0 30px 0; flex: 1; text-align: left; }
.features-list li { margin-bottom: 15px; color: #475569; display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; line-height: 1.4; }
.check { color: #10b981; font-weight: bold; font-size: 1.1rem; }

.btn-tier { width: 100%; text-align: center; background: #f1f5f9; color: #3b82f6; padding: 14px; border-radius: 8px; font-weight: 700; text-decoration: none; border: 1px solid #cbd5e1; transition: 0.2s; box-sizing: border-box; display: inline-block; }
.btn-tier:hover { background: #e2e8f0; }
.btn-tier.active { background: #3b82f6; color: white; border-color: #3b82f6; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.btn-tier.active:hover { background: #2563eb; }

@media (max-width: 1000px) {
    .floating-pill { display: none; }
    .zig-zag-row, .zig-zag-row.reverse { flex-direction: column; text-align: center; gap: 40px; }
    .hero-headline { font-size: 3.5rem; }
    .toolkit-grid { grid-template-columns: 1fr; }
}

/* =========================================
   10. PREMIUM VISUAL VIEW TRANSITIONS
   ========================================= */
@view-transition {
    navigation: auto;
}

/* Stable Layout Placeholders for Sidebar Injection */
#sidebar-target {
    width: 260px;
    background: #0f172a;
    height: 100vh;
    flex-shrink: 0;
}

/* Transition Names to Morph Persistent Elements */
#sidebar-target, .sidebar-nav {
    view-transition-name: main-sidebar;
}

.main-workspace {
    view-transition-name: main-workspace;
}

.user-badge {
    view-transition-name: user-badge;
}

.ai-persona-pill {
    view-transition-name: ai-persona-pill;
}

/* React root container layout (ensures horizontal layout for React pages) */
#root {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* =========================================
   10. CREATOR STUDIO SPLIT-SCREEN LAYOUT
   ========================================= */
.studio-layout { display: flex; gap: 30px; max-width: 1200px; margin: 0 auto; padding-bottom: 150px; align-items: flex-start; }
.composer-section { flex: 1; min-width: 0; }
.sidebar-section { width: 380px; flex-shrink: 0; position: sticky; top: 20px; }

/* COMPOSER STYLES */
.thread-block { background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; margin-bottom: 20px; position: relative; transition: 0.3s; }
.thread-block:focus-within { border-color: #3b82f6; box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1); }
.thread-block:not(:last-child)::after { content: ''; position: absolute; bottom: -20px; left: 45px; width: 2px; height: 20px; background: #cbd5e1; }

.post-number { position: absolute; top: 25px; left: -15px; background: #3b82f6; color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.9rem; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.composer-input { box-sizing: border-box; width: 100%; min-height: 120px; padding: 15px 15px 15px 40px; border: none; font-family: inherit; font-size: 1.1rem; resize: none; color: #0f172a; line-height: 1.5; background: transparent; }
.composer-input:focus { outline: none; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 15px; margin-top: 10px; }
.char-counter { font-size: 0.85rem; font-weight: bold; color: #64748b; transition: color 0.3s; }

.btn-add-post { background: transparent; color: #3b82f6; border: 2px dashed #3b82f6; padding: 15px; border-radius: 12px; font-weight: bold; cursor: pointer; width: 100%; font-size: 1rem; transition: 0.2s; margin-bottom: 20px; }
.btn-add-post:hover { background: #eff6ff; }

/* THE SIMPLIFIED TOPIC BAR */
.topic-bar { background: #fff; padding: 15px 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; margin-bottom: 30px; display: flex; gap: 20px; flex-wrap: wrap; }
.topic-row { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 250px; }
.topic-label { font-weight: bold; font-size: 0.9rem; color: #0f172a; white-space: nowrap; }
.topic-input-wrapper { flex: 1; }
.topic-input { width: 100%; padding: 10px 15px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; font-family: inherit; }

/* RIGHT SIDEBAR ELEMENTS */
.sidebar-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; height: calc(100vh - 120px); min-height: 500px; display: flex; flex-direction: column; overflow: hidden; }

/* UNIFIED TABS */
.panel-tabs { display: flex; border-bottom: 1px solid #e2e8f0; background: #f8fafc; flex-shrink: 0; }
.panel-tab { flex: 1; padding: 15px 5px; text-align: center; font-weight: bold; cursor: pointer; border: none; background: transparent; color: #64748b; font-size: 0.9rem; border-bottom: 2px solid transparent; transition: 0.2s; }
.panel-tab:hover { color: #0f172a; background: #f1f5f9; }
.panel-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; background: #fff; }

.trend-card { padding: 15px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; }
.trend-card:hover { border-color: #3b82f6; background: #f8fafc; transform: translateX(2px); }
.trend-card-title { font-weight: bold; color: #0f172a; font-size: 0.95rem; margin-bottom: 5px; }
.trend-card-desc { font-size: 0.8rem; color: #64748b; line-height: 1.4; margin-bottom: 10px; }
.btn-ai-trend { background: #8b5cf6; color: white; border: none; padding: 8px; border-radius: 6px; font-weight: bold; font-size: 0.85rem; cursor: pointer; transition: 0.2s; width: 100%; text-align: center; }
.btn-ai-trend:hover { background: #7c3aed; }

/* ACTION BAR - FIXED ALIGNMENT */
.action-bar { position: fixed; bottom: 0; left: 260px; width: calc(100% - 260px); background: white; padding: 15px 30px; box-shadow: 0 -4px 20px rgba(0,0,0,0.05); display: flex; justify-content: center; z-index: 100; border-top: 1px solid #e2e8f0; box-sizing: border-box; }
.action-bar-inner { max-width: 1200px; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; }
.btn-post-now { background: #10b981; color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.btn-post-now:hover { background: #059669; transform: translateY(-2px); }
.btn-schedule { background: #3b82f6; color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.btn-schedule:hover { background: #2563eb; transform: translateY(-2px); }
.btn-draft { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.btn-draft:hover { background: #e2e8f0; color: #0f172a; transform: translateY(-2px); }
.remove-post { color: #94a3b8; cursor: pointer; font-size: 0.85rem; border: none; background: none; transition: 0.2s; font-weight: bold; }
.remove-post:hover { color: #ef4444; }

/* THE MOBILE PREVIEW FRAME */
.mobile-preview-wrapper {
    width: 300px;
    height: 550px;
    background: #fff;
    border: 12px solid #0f172a;
    border-radius: 35px;
    margin: 20px auto;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    flex-shrink: 0;
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
.mobile-preview-wrapper::-webkit-scrollbar { display: none; }

.phone-header {
    height: 25px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.phone-notch {
    width: 100px;
    height: 15px;
    background: #0f172a;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

@keyframes pulse-rocket {
    0% { transform: scale(1); }
    50% { transform: scale(1.15) translateY(-5px); }
    100% { transform: scale(1); }
}

/* =========================================
   11. PUBLISHING QUEUE LAYOUT
   ========================================= */
/* MONTH VIEW STYLES */
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; min-width: 800px; }
.month-day { border: 1px solid #e2e8f0; border-radius: 8px; min-height: 120px; background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.month-day-header { padding: 4px 8px; background: #f8fafc; font-weight: bold; font-size: 0.85rem; color: #475569; border-bottom: 1px solid #e2e8f0; }
.month-day-content { padding: 4px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.month-empty-slot { font-size: 0.7rem; padding: 4px; border: 1px dashed #cbd5e1; text-align: center; color: #94a3b8; cursor: pointer; border-radius: 4px; background: #f8fafc; transition: 0.2s; }
.month-empty-slot:hover { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; }
.month-item { font-size: 0.7rem; padding: 4px; background: #fff; border: 1px solid #cbd5e1; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.month-item.locked-post { border-left: 3px solid #ef4444; background: #fff5f5; }
.month-item.user-locked { border-left: 3px solid #f59e0b; background: #fffbeb; }
.month-header-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 8px; min-width: 800px; }
.month-header-cell { text-align: center; font-weight: bold; color: #64748b; font-size: 0.85rem; padding: 4px 0; }
.month-day.out-of-month { opacity: 0.4; background: #f1f5f9; }

/* Modernised Shuffle Button */
.btn-shuffle { 
    background: linear-gradient(135deg, #8b5cf6, #3b82f6); 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    border-radius: 10px; 
    font-weight: 800; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    font-size: 0.95rem; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); 
}
.btn-shuffle:hover { 
    background: linear-gradient(135deg, #7c3aed, #2563eb); 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4); 
}
.btn-shuffle:active {
    transform: translateY(0);
}

.scrollable-panel {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    padding-right: 15px;
    margin-bottom: 40px;
}
.scrollable-panel::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollable-panel::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.scrollable-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.scrollable-panel::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.timeline-container { position: relative; margin-bottom: 10px; }
.timeline-row { display: flex; align-items: stretch; margin-bottom: 20px; }

.timeline-time { width: 140px; text-align: right; padding-right: 25px; padding-top: 25px; border-right: 3px solid #f1f5f9; position: relative; flex-shrink: 0; }
.timeline-time::after { content: ''; position: absolute; right: -8px; top: 32px; width: 13px; height: 13px; background: #cbd5e1; border-radius: 50%; box-shadow: 0 0 0 4px #f8fafc; transition: 0.3s; }
.timeline-time.has-post::after { background: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); }

.time-day { font-weight: bold; color: #0f172a; font-size: 1rem; }
.time-hour { color: #64748b; font-size: 0.9rem; margin-top: 4px; font-weight: 500; }

.timeline-dropzone { flex: 1; padding-left: 30px; min-height: 90px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.empty-slot-placeholder { height: 100%; min-height: 90px; border: 2px dashed #cbd5e1; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-weight: bold; font-size: 0.95rem; transition: 0.2s; background: #f8fafc; cursor: pointer; text-decoration: none;}
.empty-slot-placeholder:hover { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; transform: scale(1.01); }
.timeline-dropzone.sortable-dragover .empty-slot-placeholder { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; transform: scale(1.01); }

.drag-handle { color: #cbd5e1; cursor: grab; font-size: 1.5rem; padding: 0 10px; user-select: none; transition: 0.2s; }
.drag-handle:hover { color: #3b82f6; }
.queue-item:active .drag-handle { cursor: grabbing; }
.sortable-ghost { opacity: 0.4; background: #f8fafc; border: 2px dashed #3b82f6 !important; }
.sortable-drag { cursor: grabbing !important; box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important; transform: scale(1.02); z-index: 100; }

/* 🚀 NEW TIMED FOLLOW-UP & LOCK STYLES */
.status-locked { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.followup-badge { background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
.queue-item.locked-post { border-left: 4px solid #ef4444; background: #fff5f5; margin-left: 20px; }
.week-item.locked-post { border-top: 4px solid #ef4444; background: #fff5f5; }

/* User-Locked styling */
.queue-item.user-locked { border-left: 4px solid #f59e0b; background: #fffbeb; }
.week-item.user-locked { border-top: 4px solid #f59e0b; background: #fffbeb; }

/* =========================================
   12. CONTENT RADAR LAYOUT
   ========================================= */
.freeform-card { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #3b82f6; margin-bottom: 40px; position: relative; overflow: hidden; transition: 0.3s; }
.freeform-card::before { content: ''; position: absolute; top: 0; left: 0; width: 6px; height: 100%; background: #3b82f6; }
.freeform-input { width: 100%; height: 90px; padding: 15px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 1rem; margin-bottom: 15px; box-sizing: border-box; resize: none; background: #f8fafc; transition: 0.3s;}
.freeform-input:focus { outline: none; border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.news-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px; transition: 0.2s; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.news-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); border-color: #cbd5e1; }
.news-category { font-size: 0.75rem; text-transform: uppercase; font-weight: 800; color: #3b82f6; letter-spacing: 0.05em; margin-bottom: 10px; }
.news-title { font-size: 1.15rem; font-weight: bold; color: #0f172a; margin-bottom: 15px; line-height: 1.4; }
.news-snippet { font-size: 0.9rem; color: #64748b; line-height: 1.5; margin-bottom: 20px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-footer { border-top: 1px solid #f1f5f9; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; }
.btn-ghostwrite { background: #0f172a; color: white; border: none; padding: 10px 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 0.9rem; }
.btn-ghostwrite:hover { background: #1e293b; }
.btn-read { color: #3b82f6; text-decoration: none; font-size: 0.9rem; font-weight: bold; }
.btn-read:hover { text-decoration: underline; }

/* THE MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); display: none; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal-content { background: white; width: 90%; max-width: 600px; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.2); animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 20px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.modal-header h3 { margin: 0; color: #0f172a; display: flex; align-items: center; gap: 10px; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: #94a3b8; cursor: pointer; transition: 0.2s; }
.close-btn:hover { color: #0f172a; }

/* USAGE BADGES */
.usage-badge { font-size: 0.85rem; padding: 4px 12px; border-radius: 20px; font-weight: bold; transition: 0.3s; display: inline-flex; align-items: center; gap: 5px; }
.badge-safe { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-warn { background: #fef08a; color: #854d0e; border: 1px solid #fde047; }
.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.disabled-element { background: #e2e8f0 !important; cursor: not-allowed !important; opacity: 0.7; color: #64748b !important; }

/* =========================================
   13. SCHEDULER & OPTIMISATION LAYOUT
   ========================================= */
.legend { display: flex; gap: 20px; background: white; padding: 15px 25px; border-radius: 8px; border: 1px solid #eaeaea; margin-bottom: 20px; font-size: 0.85rem; color: #555; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-box { width: 16px; height: 16px; border-radius: 3px; }

.heatmap-container { background: #fff; padding: 25px 25px 40px 25px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #eaeaea; overflow-x: auto; overflow-y: hidden; margin-bottom: 20px; }
.heatmap-grid { display: grid; grid-template-columns: 80px repeat(24, minmax(25px, 1fr)); gap: 4px; align-items: center; min-width: 800px; }
.y-axis-label { font-weight: bold; font-size: 0.8rem; color: #555; text-align: right; padding-right: 15px; }
.x-axis-label { font-size: 0.75rem; font-weight: bold; color: #888; text-align: center; padding-bottom: 10px; }

.heat-cell { aspect-ratio: 1; border-radius: 4px; background-color: #f0f0f0; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: transparent; cursor: pointer; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-sizing: border-box; white-space: nowrap; }
.heat-cell:hover { transform: scale(1.4); color: #000; font-weight: bold; z-index: 10; background-color: #fff !important; box-shadow: 0 0 0 2px #000, 0 4px 12px rgba(0,0,0,0.2); }
.empty-cell { background-color: #fafafa; border: 1px solid #f0f0f0; }
.low-data-cell { background-color: #f8f9fa; color: #ccc; border: 1px dashed #ddd; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 15px; margin-top: 10px; }
.calendar-day { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 15px 10px; min-height: 250px; }

.time-slot { background: #fff; border: 1px solid #cce5ff; border-left: 4px solid #3b82f6; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.remove-icon { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 1.2rem; font-weight: bold; padding: 0; line-height: 1; opacity: 0.6; transition: 0.2s; }
.remove-icon:hover { opacity: 1; transform: scale(1.1); }

.manual-add-section { margin-top: 40px; background: #fff; padding: 25px; border-radius: 12px; border: 1px solid #ddd; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.quick-btn { background: #eaeaea; color: #333; border: 1px solid #ccc; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: bold; margin-right: 8px; transition: 0.2s; margin-bottom: 15px; }
.quick-btn:hover { background: #ddd; }
.day-checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px; }
.day-pill { display: flex; align-items: center; gap: 8px; background: #f4f4f4; padding: 10px 15px; border-radius: 8px; border: 1px solid #ddd; cursor: pointer; user-select: none; transition: 0.2s; font-weight: bold; color: #444; }
.day-pill:hover { background: #e9ecef; }
.day-pill input[type="checkbox"] { transform: scale(1.2); cursor: pointer; }
.time-sel { padding: 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; width: 100px; text-align: center; background: #fff; }

/* =========================================
   14. STRATEGY CONSULTANT LAYOUT
   ========================================= */
.strategy-guide { background: #f0f7ff; border: 1px solid #bae6fd; padding: 20px 25px; border-radius: 12px; margin-bottom: 30px; display: flex; gap: 20px; align-items: flex-start; }
.guide-icon { font-size: 1.5rem; background: #fff; padding: 10px; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.guide-text h2 { margin: 0 0 8px 0; font-size: 1.1rem; color: #0369a1; }
.guide-text p { margin: 0; font-size: 0.9rem; color: #0c4a6e; line-height: 1.5; }
.guide-text strong { color: #0369a1; }

.ai-panel { background: linear-gradient(145deg, #0f172a, #1e293b); color: #fff; padding: 40px; border: none; margin-bottom: 30px; border-radius: 16px; }
.ai-panel .card-title { color: #fff; margin-bottom: 30px; font-size: 1.3rem; display: flex; justify-content: space-between; align-items: center; }

.audit-result { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); padding: 35px; border-radius: 12px; font-size: 1.05rem; line-height: 1.7; color: #e2e8f0; }
.audit-result h1, .audit-result h2, .audit-result h3 { color: #fff; margin-top: 0; }
.audit-result strong { color: #38bdf8; }
.audit-result ul { padding-left: 20px; margin-bottom: 20px; }
.audit-result p:last-child { margin-bottom: 0; }

.loading-msg { font-size: 1.1rem; color: #94a3b8; display: flex; align-items: center; gap: 10px; }

#chat-window { height: 400px; overflow-y: auto; padding: 25px; display: flex; flex-direction: column; gap: 15px; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 15px; scroll-behavior: smooth; }
.msg-ai { background: #fff; border: 1px solid #e2e8f0; padding: 15px 20px; border-radius: 12px; align-self: flex-start; max-width: 85%; font-size: 0.95rem; line-height: 1.6; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.msg-user { background: #0f172a; color: #fff; padding: 15px 20px; border-radius: 12px; align-self: flex-end; max-width: 85%; font-size: 0.95rem; }
.msg-ai p { margin: 0 0 10px 0; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai ul, .msg-ai ol { padding-left: 20px; margin-bottom: 10px; }
.msg-ai strong { color: #000; font-weight: 700; }

.typing-bubble { background: #fff; border: 1px solid #e2e8f0; padding: 15px 20px; border-radius: 12px; align-self: flex-start; display: flex; gap: 4px; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.dot { width: 6px; height: 6px; background: #94a3b8; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.prompt-pills-container { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.prompt-pill { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; color: #475569; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.prompt-pill:hover { background: #e2e8f0; color: #0f172a; border-color: #94a3b8; transform: translateY(-1px); }

/* =========================================
   15. VIRAL VAULT LAYOUT
   ========================================= */
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px; margin-top: 10px; }
.vault-card { background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); border: 1px solid #e2e8f0; display: flex; flex-direction: column; position: relative; transition: 0.3s; }
.vault-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-color: #cbd5e1; }

.rank-badge { position: absolute; top: -12px; left: -12px; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); border: 3px solid #fff; }
.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); width: 50px; height: 50px; font-size: 1.4rem; top: -15px; left: -15px; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); width: 45px; height: 45px; font-size: 1.2rem; }
.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); width: 45px; height: 45px; font-size: 1.2rem; }

.post-text { font-size: 1rem; color: #1e293b; line-height: 1.5; margin-bottom: 20px; white-space: pre-wrap; word-break: break-word; flex-grow: 1; }
.post-date { font-size: 0.8rem; color: #94a3b8; margin-bottom: 15px; font-weight: bold; }

.metrics-bar { display: flex; justify-content: space-between; padding: 15px; background: #f8fafc; border-radius: 8px; margin-bottom: 20px; border: 1px solid #f1f5f9; }
.metric { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.metric-val { font-weight: bold; color: #0f172a; font-size: 1.1rem; }
.metric-label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }

.btn-recycle { background: #3b82f6; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.95rem; text-decoration: none; }
.btn-recycle:hover { background: #2563eb; }

.explainer-banner { background: linear-gradient(to right, #f8fafc, #eff6ff); border: 1px solid #bfdbfe; border-radius: 12px; padding: 25px; margin-bottom: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.explainer-banner h3 { margin: 0 0 10px 0; color: #1e293b; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.explainer-banner p { margin: 0 0 12px 0; color: #475569; line-height: 1.6; font-size: 0.95rem; }
.ai-tip-box { background: #fff; padding: 15px; border-radius: 8px; border-left: 4px solid #8b5cf6; font-size: 0.9rem; color: #334155; margin-top: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }

.locked-state-card { grid-column: 1 / -1; background: linear-gradient(145deg, #0f172a, #1e293b); border-radius: 16px; padding: 70px 30px; text-align: center; color: white; position: relative; overflow: hidden; border: 1px solid #334155; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.locked-state-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b); }
.btn-upgrade { display: inline-block; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 14px 32px; border-radius: 8px; font-weight: bold; font-size: 1.1rem; text-decoration: none; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); transition: transform 0.2s; }
.btn-upgrade:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6); }

/* =========================================
   16. SETTINGS DETAILS & SEATS LAYOUT
   ========================================= */
.setting-group { margin-bottom: 25px; }
.setting-group label { display: block; font-weight: 700; color: #0f172a; margin-bottom: 10px; font-size: 0.95rem; }
.setting-group input, .setting-group select, .setting-group textarea {
    width: 100%;
    padding: 16px; 
    border: 2px solid #e2e8f0; 
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.setting-group input:focus, .setting-group select:focus, .setting-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.progress-container { background: #e2e8f0; height: 10px; border-radius: 5px; overflow: hidden; margin: 12px 0; }
.progress-fill { background: #3b82f6; width: 0%; height: 100%; transition: width 0.6s ease; }
.progress-fill.warning { background: #f59e0b; }
.progress-fill.danger { background: #ef4444; }

.security-block { background: #f8fafc; padding: 30px; border-radius: 16px; border: 2px solid #e2e8f0; margin-bottom: 25px; }
.security-block h4 { margin-top: 0; color: #0f172a; margin-bottom: 20px; font-size: 1.1rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; }

.account-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.account-card { display: flex; align-items: center; justify-content: space-between; padding: 15px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; }
.account-info { display: flex; align-items: center; gap: 15px; }
.account-avatar { width: 40px; height: 40px; border-radius: 50%; background: #e2e8f0; object-fit: cover; }
.account-name { font-weight: 700; color: #0f172a; }
.account-status { font-size: 0.8rem; padding: 4px 8px; border-radius: 12px; background: #e2e8f0; color: #64748b; font-weight: bold; }
.account-status.active { background: #dcfce7; color: #166534; }

.btn-disconnect { background: #fff; border: 1px solid #fecaca; color: #ef4444; padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-disconnect:hover { background: #ef4444; color: #fff; }

.clone-voice-block { background: #e0f2fe; border: 2px solid #bae6fd; padding: 20px; border-radius: 12px; margin-bottom: 25px; }
.profile-builder { background: #f8fafc; padding: 35px; border-radius: 16px; border: 2px solid #e2e8f0; margin-top: 40px; }
.empty-state { text-align: center; padding: 20px; color: #94a3b8; font-weight: bold; background: #f8fafc; border-radius: 8px; }
.delete-btn { background: #fff; border: 1px solid #fecaca; color: #ef4444; padding: 8px 16px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.delete-btn:hover { background: #ef4444; color: #fff; }

/* =========================================
   17. DEMOGRAPHICS GRID & GEO LAYOUTS
   ========================================= */
.chart-wrapper {
    height: 250px;
    position: relative;
}

.demographics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.demographics-grid .age-card {
    grid-column: span 2;
}

.demographics-grid .loc-card {
    grid-column: span 1;
}

.demographics-grid .gender-card {
    grid-column: span 1;
}

.geo-list { list-style: none; padding: 0; margin: 0; }
.geo-list li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }
.geo-list li:last-child { border-bottom: none; }
.geo-bar-bg { width: 100%; background: #f1f5f9; border-radius: 4px; height: 6px; margin-top: 6px; overflow: hidden; }
.geo-bar-fill { background: #3b82f6; height: 100%; border-radius: 4px; }

@media (max-width: 768px) {
    .demographics-grid {
        grid-template-columns: 1fr;
    }
    .demographics-grid .age-card,
    .demographics-grid .loc-card,
    .demographics-grid .gender-card {
        grid-column: span 1;
    }
}

/* PDF REPORT MODAL STYLES */
.main-workspace:has(.report-modal-overlay),
.main-workspace:has(.modal-overlay),
.main-workspace:has(.global-modal-overlay) {
    position: relative;
    z-index: 2001; /* Elevates the workspace content layer above the sidebar only when a modal is open */
}

.report-modal-overlay { position: fixed; top: 0; left: 260px; width: calc(100% - 260px); height: 100%; background: rgba(15, 23, 42, 0.6); display: flex; justify-content: center; align-items: center; z-index: 2000; backdrop-filter: blur(4px); }
.report-modal-content { background: #f8fafc; width: 95%; max-width: 1250px; height: 92vh; border-radius: 16px; display: flex; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); animation: reportSlideUp 0.3s ease-out; }
@keyframes reportSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.report-config-panel { width: 400px; background: white; border-right: 1px solid #e2e8f0; padding: 25px; display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; overflow-y: auto; }
.report-preview-panel { flex: 1; padding: 40px; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 30px; background: #475569; }
.pdf-page-container { width: 792px; height: 1120px; background: white; padding: 50px; box-sizing: border-box; box-shadow: 0 10px 25px rgba(0,0,0,0.3); position: relative; overflow: hidden; display: flex; flex-direction: column; text-align: left; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
.report-config-panel input, .report-config-panel select, .report-config-panel textarea {
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.report-config-panel input:focus, .report-config-panel select:focus, .report-config-panel textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* PDF generation print overrides to avoid page spillovers and blank pages */
.rendering-pdf {
    gap: 0 !important;
}

.rendering-pdf .pdf-page-container {
  width: 792px;
  height: 1120px;
  overflow: hidden;
  position: relative;
  background-color: var(--card-bg, #ffffff);
  color: var(--text-color, #1f2937);
  box-sizing: border-box;
  page-break-after: always; /* Force page break after each container */
  break-after: page;
}
