/* ==========================================================================
   NestLink - Premium Mobile App Simulator Design System (Facebook-Style)
   ========================================================================== */

:root {
    /* Color Palette - Royal Blue & Slate (NestLink Theme 🍀) */
    --primary: #1877f2; /* Facebook-like Royal Blue */
    --primary-hover: #166fe5;
    --primary-light: rgba(24, 119, 242, 0.15);
    
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-glass: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-active: #ffffff;
    
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --accent-blue: #3b82f6;
    
    /* Font Stack */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Phone Specs */
    --phone-width: 390px;
    --phone-height: 844px;
    --phone-radius: 48px;
    --phone-border: 12px;
}

/* Light Theme Variables */
body.light-mode {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-glass: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.08);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-active: #0f172a;
    
    --primary-light: rgba(24, 119, 242, 0.1);
}

/* Base Reset & Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   iOS WEBVIEW ANTI-ZOOM RULE
   iOS Safari / WKWebView automatically zooms in on any input/textarea/select
   that has font-size < 16px upon focus. Enforcing 16px minimum prevents
   automatic zooming completely on both iOS Simulators and physical iPhones.
   ========================================================================== */
input,
textarea,
select {
    font-size: 16px !important;
}

/* Application Container (Centered Single Frame) */
.app-container {
    display: flex;
    width: 100%;
    max-width: 1300px;
    height: 95vh;
    gap: 30px;
    padding: 20px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ==========================================================================
   APP SPLASH SCREEN (Fast Cold Start / Auth Gateway)
   ========================================================================== */
.app-splash-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1e293b 0%, #070d18 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.app-splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    transform: scale(1);
    opacity: 1;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-splash-screen.fade-out .splash-content {
    transform: scale(0.92);
    opacity: 0;
}

.splash-logo-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 24px rgba(24, 119, 242, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.splash-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.splash-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.splash-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    margin: -6px 0 0 0;
    letter-spacing: 0.2px;
}

/* ==========================================================================
   LOGIN / SIGNUP SCREEN OVERLAY (Simulated App Gateway)
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 40px 30px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(24, 119, 242, 0.4);
}

.login-logo-area h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.login-logo-area p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.login-footer {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   LEFT PANEL: Intro & Developer Console
   ========================================================================== */
.left-panel {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.left-panel::-webkit-scrollbar {
    width: 6px;
}
.left-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.panel-header .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-emblem-wrapper {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.panel-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.panel-header .tagline {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
}

.features-list {
    margin: 30px 0;
}

.features-list h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.features-list ul {
    list-style: none;
}

.features-list li {
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-main);
}

.features-list li strong {
    font-weight: 600;
}

.features-list .bullet {
    color: var(--primary);
    font-weight: bold;
    margin-right: 8px;
}

/* Developer Logs Terminal */
.dev-logs-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #090d16;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    min-height: 250px;
    margin-bottom: 20px;
}

.logs-header {
    display: flex;
    align-items: center;
    background: #141b2a;
    padding: 10px 16px;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logs-header .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.logs-header .dot.red { background-color: var(--accent-red); }
.logs-header .dot.yellow { background-color: var(--accent-amber); }
.logs-header .dot.green { background-color: #10b981; }

.logs-header .title {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    flex-grow: 1;
}

.clear-logs-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}
.clear-logs-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.logs-body {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logs-body::-webkit-scrollbar {
    width: 6px;
}
.logs-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.log-line {
    animation: fadeIn 0.15s ease-out forwards;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line.system { color: #3b82f6; }
.log-line.user { color: #f59e0b; }
.log-line.db { color: #10b981; }
.log-line.warning { color: #ef4444; }

.footer-info {
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* ==========================================================================
   RIGHT PANEL: Mobile Simulator & App Design
   ========================================================================== */
.simulator-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* iPhone Bezel simulation */
.iphone-frame {
    width: var(--phone-width);
    height: var(--phone-height);
    background: #020617;
    border: var(--phone-border) solid #1e293b;
    border-radius: var(--phone-radius);
    position: relative;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* iPhone Bezel shadow reflection overlay */
.iphone-frame::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: calc(var(--phone-radius) - var(--phone-border));
    border: 2px solid rgba(255,255,255,0.1);
    pointer-events: none;
    z-index: 100;
}

/* Dynamic Island */
.dynamic-island {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 30px;
    background: #000;
    border-radius: 15px;
    z-index: 99;
    box-shadow: inset 0 0 4px rgba(255,255,255,0.2);
}

.speaker {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #111;
    border-radius: 2px;
    z-index: 99;
}

/* Main Screen Wrapper */
.screen-content {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    position: relative;
    user-select: none;
}

/* Status Bar */
.status-bar {
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 28px 6px;
    font-size: 13px;
    font-weight: 600;
    z-index: 98;
}

.status-bar .time {
    color: var(--text-main);
}

.status-bar .status-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.status-bar .status-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5px;
    color: var(--text-main);
}

/* App Header - Emoji + Text style with custom Logo Image */
.app-header {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(52px + env(safe-area-inset-top, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card-glass);
    backdrop-filter: blur(12px);
    z-index: 90;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
}

.app-logo .text {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.header-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2px;
}

/* Badges */
.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-red);
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    border-radius: 7px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bg-dark);
    box-sizing: border-box;
    pointer-events: none;
}

.badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent-red);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--bg-dark);
}

/* App Viewport Container */
.app-viewport {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    z-index: 1; /* Isolates viewport screens & sub-panels inside a local stacking context */
}

/* Screen Views */
.screen-view {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    animation: fadeScale 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.screen-view.active {
    display: flex;
}

.screen-view::-webkit-scrollbar {
    width: 0px; /* Hide scrollbars inside device simulation */
}

/* Screen General Typography */
.screen-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.screen-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 20px;
}

/* Tab Navigation Bar */
.tab-bar {
    height: 64px;
    display: flex;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-glass);
    backdrop-filter: blur(12px);
    padding-bottom: 8px; /* Offset for iOS home indicator area */
    position: relative;
    z-index: 96; /* Stays strictly on top of .app-viewport (1) and .profile-sub-panel (95) */
}

.tab-item {
    flex: 1;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 5;
}

.tab-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

.tab-item span {
    font-size: 10px;
    font-weight: 500;
}

.tab-item.active {
    color: var(--primary);
}

/* Raised Plus Button Container & Style */
.tab-item-add-container {
    flex: 1.2;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 100;
}

.tab-add-btn {
    background-color: #0f172a; /* Deep Slate/Navy */
    color: #ffffff;
    border: 3px solid var(--bg-dark);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-16px); /* Raised effect */
    transition: transform 0.2s, background-color 0.2s;
    position: relative;
    z-index: 101;
}

.tab-add-btn:active {
    transform: translateY(-12px) scale(0.92);
}

.tab-add-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 3px;
}

/* ==========================================================================
   FEED VIEW COMPONENT STYLES
   ========================================================================== */

/* Feed Screen - Fixed Header & Dedicated Scroll Area */
#feedScreen {
    padding: 0 !important;
    overflow: hidden !important;
    display: none;
    flex-direction: column;
}

#feedScreen.active {
    display: flex;
}

/* Feed Sticky Top Bar (Search + Categories Fixed - Never Moves) */
.feed-sticky-header {
    position: relative;
    top: 0;
    z-index: 40;
    background: var(--bg-dark);
    margin: 0;
    padding: 14px 16px 2px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

body.light-mode .feed-sticky-header {
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Scrollable Feed Container (Houses Refresh Indicator and Posts) */
.feed-scroll-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 12px 16px 24px 16px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.feed-scroll-container::-webkit-scrollbar {
    width: 0px;
    display: none;
}

/* Search Bar Styling - Prevent shrink collapse */
.search-container {
    margin-bottom: 12px;
    flex-shrink: 0; /* CRITICAL FIX */
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-wrapper input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 36px 10px 36px;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.clear-search-btn svg {
    width: 14px;
    height: 14px;
}

/* Categories Tab - Prevent shrink collapse & prevent clipping on active button/glow */
.categories-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-top: 6px;
    padding-bottom: 8px;
    padding-left: 4px;
    padding-right: 4px;
    margin-bottom: 4px;
    scrollbar-width: none;
    flex-shrink: 0; /* CRITICAL FIX */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.categories-tab::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}

.category-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, #1877f2 0%, #2563eb 100%);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(24, 119, 242, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transform: none;
}

body.light-mode .category-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

body.light-mode .category-btn:hover {
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .category-btn.active {
    background: linear-gradient(135deg, #1877f2 0%, #1d4ed8 100%);
    color: #ffffff !important;
    border-color: #1877f2;
    box-shadow: 0 3px 10px rgba(24, 119, 242, 0.3);
    transform: none;
}

/* Card Feed Items */
.feed-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
    will-change: transform;
}

/* Feed Skeleton Loading Shimmer */
@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

body.light-mode .skeleton-shimmer {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.05) 75%);
    background-size: 200% 100%;
}

.skeleton-card {
    pointer-events: none;
    user-select: none;
}

/* Feed Refresh Indicator (Pull to Refresh & Spinner) */
.feed-refresh-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(-50px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    width: fit-content;
    z-index: 30;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}

@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.refresh-spinner-icon,
.refresh-spinner-svg {
    width: 16px;
    height: 16px;
    animation: spinLoader 0.75s linear infinite;
    color: var(--primary);
    flex-shrink: 0;
}

.refresh-pull-icon,
.refresh-arrow-svg {
    width: 16px;
    height: 16px;
    transition: transform 0.18s ease;
    color: var(--primary-color, #1877f2);
    flex-shrink: 0;
}

.refresh-check-svg {
    width: 16px;
    height: 16px;
    color: #10b981;
    flex-shrink: 0;
}

.refresh-pull-icon.rotate-up {
    transform: rotate(180deg);
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, opacity 0.2s;
}

/* Pinned Post Styles */
.post-card.pinned {
    border-left: 3px solid #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, var(--bg-card) 40%);
}
body.light-mode .post-card.pinned {
    border-left: 3px solid #2563eb;
    border-color: rgba(37, 99, 235, 0.25);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-card) 40%);
}
.pinned-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin: -16px -16px 8px -16px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    letter-spacing: 0.02em;
}
body.light-mode .pinned-badge {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    color: #2563eb;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

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

.author-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
}

.follow-tag {
    font-size: 11px;
    color: var(--primary);
    background: transparent;
    padding: 0;
    margin-left: 6px;
    font-weight: 600;
    cursor: pointer;
}

.post-time-category {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.post-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.dot-separator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.header-category-tag {
    color: #10b981; /* Green color style */
    font-weight: 600;
}

body.light-mode .header-category-tag {
    color: #059669;
}

/* Elegantly styled green price tag if no image is present */
.post-price-badge-no-image {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    align-self: flex-start;
}

body.light-mode .post-price-badge-no-image {
    background-color: rgba(5, 150, 105, 0.08);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.15);
}

.post-options {
    position: relative;
}

.post-options-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.post-options-dropdown {
    position: absolute;
    right: 0;
    top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
    width: 140px;
    display: none;
    overflow: hidden;
}

.post-options-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--border-color);
}

.dropdown-item.danger {
    color: var(--accent-red);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.post-body {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-main);
}

/* Hashtag / Tags clickables */
.post-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.hashtag-link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.hashtag-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   FACEBOOK-STYLE IMAGE COLLAGE GRIDS
   ========================================================================== */
.post-image-collage-grid {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
    user-select: none;
    -webkit-user-select: none;
}

.post-image-collage-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 1 Image layout */
.post-image-collage-grid.one-image {
    aspect-ratio: 16/10;
    max-height: 380px;
}

/* 2 Images layout */
.post-image-collage-grid.two-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    aspect-ratio: 16/10;
    max-height: 300px;
}

/* 3+ Images layout */
.post-image-collage-grid.multi-images {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 4px;
    height: 230px;
}

.post-image-collage-grid.multi-images > img:first-child {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
}

.multi-images-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    min-height: 0;
}

.multi-images-right > img {
    width: 100%;
    height: calc(50% - 2px);
    object-fit: cover;
    border-radius: 0 8px 0 0;
    cursor: pointer;
    display: block;
}

.more-photos-wrapper {
    position: relative;
    width: 100%;
    height: calc(50% - 2px);
    border-radius: 0 0 8px 0;
    overflow: hidden;
    cursor: pointer;
}

.more-photos-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.more-photos-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.78) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
}

.more-photos-overlay:hover {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.38) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.more-photos-overlay:active {
    transform: scale(0.98);
}

.more-photos-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    user-select: none;
    pointer-events: none;
}

.more-photos-badge svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.collage-total-pill {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.collage-total-pill svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

/* ==========================================================================
   IMAGE LIGHTBOX MODAL & SMOOTH SLIDING TRANSITIONS
   ========================================================================== */
#imageLightboxModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 12000 !important;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-top-bar {
    position: absolute;
    top: env(safe-area-inset-top, 12px);
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    z-index: 2010;
    pointer-events: none;
}

.lightbox-counter-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.lightbox-close-btn {
    pointer-events: auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, background-color 0.2s ease;
    margin-left: auto;
}

.lightbox-close-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2010;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.lightbox-nav-btn.prev {
    left: 14px;
}

.lightbox-nav-btn.next {
    right: 14px;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn:active {
    transform: translateY(-50%) scale(0.94);
}

.lightbox-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.lightbox-slide {
    position: absolute;
    max-width: 94%;
    max-height: 80%;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.85);
    object-fit: contain;
    will-change: transform, opacity, filter;
    transform-origin: center center;
    -webkit-user-drag: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    pointer-events: none !important;
}

.lightbox-zoom-bar {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox-zoom-bar button:active {
    transform: scale(0.9);
}

.post-image-collage-grid img {
    touch-action: pan-y pinch-zoom;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-dots {
    position: absolute;
    bottom: env(safe-area-inset-bottom, 24px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    z-index: 2010;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.lightbox-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-dot.active {
    width: 22px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Reverted V1 Style Price badge inside image */
.post-price-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.85);
    color: #10b981;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(4px);
    z-index: 2;
}

body.light-mode .post-price-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.2);
}

/* ==========================================================================
   TRANSLATION SUPPORT COMPONENT
   ========================================================================== */
.translation-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 0;
    margin-top: 4px;
    text-align: left;
    display: inline-block;
}

.translation-btn:hover {
    text-decoration: underline;
}

.translation-container {
    background-color: rgba(24, 119, 242, 0.05);
    border-top: 1px dashed var(--border-color);
    padding: 8px;
    margin-top: 6px;
    border-radius: 6px;
    font-size: 13px;
    font-style: italic;
    color: var(--text-main);
    animation: fadeIn 0.2s ease-out;
}

/* ==========================================================================
   FACEBOOK-STYLE ACTION ROW (FOOTER)
   ========================================================================== */
.post-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 0;
    margin-top: 6px;
}

.post-actions {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.action-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 0;
    border-radius: 6px;
    transition: all 0.2s;
}

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

body.light-mode .action-btn:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.action-btn.active.like,
.action-btn.like.active {
    color: #38bdf8;
}

.action-btn.active.like svg,
.action-btn.like.active svg {
    stroke: #38bdf8 !important;
    filter: drop-shadow(0 0 6px #38bdf8) drop-shadow(0 0 12px rgba(56, 189, 248, 0.4)) !important;
}

.action-btn.active.comment,
.action-btn.comment.active {
    color: #10b981;
}

.action-btn.active.comment svg,
.action-btn.comment.active svg {
    stroke: #10b981 !important;
    filter: drop-shadow(0 0 6px #10b981) drop-shadow(0 0 12px rgba(16, 185, 129, 0.4)) !important;
}

.action-btn.active.bookmark,
.action-btn.bookmark.active {
    color: #f59e0b;
}

.action-btn.active.bookmark svg,
.action-btn.bookmark.active svg {
    stroke: #f59e0b !important;
    filter: drop-shadow(0 0 6px #f59e0b) drop-shadow(0 0 12px rgba(245, 158, 11, 0.4)) !important;
}

.action-btn.like:hover {
    color: #38bdf8;
}
.action-btn.like:hover svg {
    filter: drop-shadow(0 0 5px #38bdf8);
}

.action-btn.comment:hover {
    color: #10b981;
}
.action-btn.comment:hover svg {
    filter: drop-shadow(0 0 5px #10b981);
}

.action-btn.bookmark:hover {
    color: #f59e0b;
}
.action-btn.bookmark:hover svg {
    filter: drop-shadow(0 0 5px #f59e0b);
}

.action-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8px;
    transition: filter 0.2s ease, stroke 0.2s ease, transform 0.15s ease;
}

.action-btn:active svg {
    transform: scale(0.9);
}

.go-to-post-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 14px;
    background: rgba(24, 119, 242, 0.12);
    color: var(--primary-color, #1877f2);
    border: 1px solid rgba(24, 119, 242, 0.28);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.go-to-post-btn:hover {
    background: var(--primary-color, #1877f2);
    color: #ffffff;
    border-color: var(--primary-color, #1877f2);
}

.go-to-post-btn svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.2px;
}

body.light-mode .go-to-post-btn {
    background: rgba(24, 119, 242, 0.08);
    border-color: rgba(24, 119, 242, 0.22);
    color: #1877f2;
}

body.light-mode .go-to-post-btn:hover {
    background: #1877f2;
    color: #ffffff;
}

/* ==========================================================================
   POST COMMENTS SECTION WITH NESTED REPLIES
   ========================================================================== */
.post-comments-container {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    margin-top: 6px;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.post-comments-container.open {
    display: flex;
}

body.light-mode .post-comments-container {
    background-color: rgba(0, 0, 0, 0.02);
}

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

.comment-row {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-main);
    padding: 4px 6px;
    background-color: rgba(255,255,255,0.02);
    border-radius: 8px;
    position: relative;
}

body.light-mode .comment-row {
    background-color: rgba(0,0,0,0.015);
}

.commenter-name {
    font-weight: 700;
    margin-right: 6px;
    color: var(--text-main);
}

.comment-text-wrapper {
    margin-bottom: 4px;
}

.comment-actions-bar {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.comment-actions-bar .comment-reply-btn {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary);
}

.comment-actions-bar .comment-reply-btn:hover {
    text-decoration: underline;
}

/* Nested replies block (Facebook styled indents) */
.replies-list {
    margin-left: 18px;
    border-left: 2px solid var(--border-color);
    padding-left: 10px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reply-row {
    font-size: 12px;
    padding: 3px 6px;
    background-color: rgba(255,255,255,0.01);
    border-radius: 6px;
}

/* Comment & Reply Avatar */
.comment-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-main);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

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

.reply-avatar {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-main);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

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

/* Reply input indicator overlay */
.reply-target-indicator {
    background-color: var(--primary-light);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.reply-target-indicator span {
    font-weight: 600;
}

.reply-target-indicator button {
    background: transparent;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.comment-input-wrapper {
    position: relative;
    width: 100%;
}

.comment-input-wrapper input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 9px 38px 9px 14px;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-input-wrapper input:focus {
    border-color: var(--primary);
}

.comment-submit-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.comment-submit-btn svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   DEVICE FILE PICKER COMPONENT STYLES
   ========================================================================== */
.custom-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed var(--border-color);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.custom-file-label:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--text-main);
}

.file-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.image-preview-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.preview-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    animation: popIn 0.2s ease-out forwards;
}

/* ==========================================================================
   PROFILE SCREEN COMPONENT SUB-PANELS
   ========================================================================== */
.profile-sub-panel {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-dark);
    z-index: 95;
    display: flex;
    flex-direction: column;
    padding: 16px;
    animation: slideInRight 0.25s ease-out forwards;
    overflow: hidden;
}

.settings-content,
.account-status-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.edit-profile-panel .modal-form {
    flex: 1;
    overflow-y: auto;
    padding: 16px 4px 40px 4px;
}

.notifications-panel {
    padding-top: 16px !important;
}

.active-chat-view {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-dark);
    z-index: 95;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
}

.back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-color, #fff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

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

.back-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
}

body.light-mode .back-btn {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main, #0f172a);
}

body.light-mode .back-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.chat-header .back-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    margin-left: 8px;
}

.chat-user-info .chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid var(--border-color);
}

.chat-user-name-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
}

.chat-status {
    font-size: 11px;
    color: #10b981;
}

.chat-option-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
}
.chat-option-btn.danger {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.08);
}

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

/* Chat Messages Container */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--bg-dark);
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.08);
    border-radius: 4px;
}

/* Message Bubbles */
.message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}
.message-row.sent {
    justify-content: flex-end;
}
.message-row.received {
    justify-content: flex-start;
}
.chat-bubble-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: var(--border-color);
}
.chat-bubble-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.notification-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: var(--border-color);
}
.notification-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
    animation: slideInUp 0.15s ease-out forwards;
}

.message-bubble.received {
    align-self: flex-start;
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.message-bubble.sent {
    align-self: flex-end;
    background-color: var(--primary);
    color: #ffffff;
    border-top-right-radius: 4px;
}

.message-time {
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    text-align: right;
    display: block;
}
.message-bubble.received .message-time {
    color: var(--text-muted);
}

/* Chat Input Area */
.chat-input-area {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
}

.chat-input-area input {
    flex-grow: 1;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.send-message-btn {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.send-message-btn:hover {
    background-color: var(--primary-hover);
}
.send-message-btn:active {
    transform: scale(0.95);
}
.send-message-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 1px;
}

.panel-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.panel-header-inline h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.saved-posts-list,
.my-posts-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.saved-posts-list::-webkit-scrollbar,
.my-posts-list::-webkit-scrollbar,
.mp-quick-category-bar::-webkit-scrollbar {
    display: none;
}

/* Language selector list */
.language-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
}

.lang-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.lang-item:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

/* Edit Profile details preview container */
.profile-pic-preview-container {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.profile-pic-preview-container img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.profile-email-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 4px;
}

.log-out-item:hover {
    background-color: rgba(239, 68, 68, 0.05) !important;
}

.delete-account-item {
    margin-top: 4px;
    border-top: 1px solid rgba(220, 38, 38, 0.1);
    padding-top: 12px !important;
}

.delete-account-item:hover {
    background-color: rgba(220, 38, 38, 0.08) !important;
}

/* ==========================================================================
   MODAL DIALOG STYLES
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 110;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out forwards;
    cursor: pointer;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    cursor: default;
}

.modal-card.mini {
    max-width: 320px;
}

.modal-card.bottom-sheet {
    align-self: flex-end;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    max-height: 88vh;
    animation: slideUpSheet 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
        opacity: 0.6;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Public Profile Segmented Tabs */
.public-profile-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-color);
}
body:not(.light-mode) .public-profile-tabs {
    background: rgba(0, 0, 0, 0.35);
}
.public-tab-btn {
    flex: 1;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-muted);
    text-align: center;
}
.public-tab-btn.active {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}
.public-tab-btn:not(.active) {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
}
body.light-mode .public-tab-btn.active {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
}
body.light-mode .public-tab-btn:not(.active) {
    color: #64748b !important;
}

/* Universal Bottom Sheet Modal (Report Sheet etc.) */
#reportSheetModal.modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
    z-index: 10050 !important;
    background: rgba(0, 0, 0, 0.65);
}

#reportSheetModal .modal-card.bottom-sheet {
    width: 100% !important;
    max-width: 520px !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
    margin: 0 auto !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35) !important;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    animation: slideUpSheet 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#reportSheetModal .modal-header {
    flex-shrink: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

#reportSheetModal .modal-body.scrollable {
    flex: 1;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 20px 20px !important;
}

.strike-pip {
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
}

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

.modal-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group select,
.form-group textarea,
.form-group input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group textarea:focus,
.form-group input:focus {
    border-color: var(--primary);
}

.submit-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

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

.modal-body {
    padding: 20px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-main);
}

.modal-body.scrollable {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.danger-btn {
    background: var(--accent-red);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
    position: fixed;
    top: max(24px, env(safe-area-inset-top, 24px));
    right: 24px;
    z-index: 999999 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

@media (max-width: 600px) {
    .toast-container {
        top: max(16px, env(safe-area-inset-top, 16px));
        left: 16px;
        right: 16px;
        align-items: center;
    }
    .toast {
        min-width: 0;
        width: 100%;
        max-width: 380px;
        box-sizing: border-box;
    }
}

.toast {
    min-width: 260px;
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: auto;
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.toast.danger {
    border-left-color: var(--accent-red);
}

.toast.warning {
    border-left-color: var(--accent-amber);
}

.toast.info {
    border-left-color: var(--accent-blue);
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

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

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

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   PROFILE SCREEN COMPONENT STYLES
   ========================================================================== */
.profile-header-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 20px;
}
.profile-avatar-container {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    border-radius: 50%;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    border: 3px solid var(--primary);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin: 0 auto 12px auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}
.profile-avatar-container img,
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    pointer-events: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}
.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}
.profile-bio {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 16px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.stat-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.25);
}
.stat-item:active {
    transform: translateY(1px) scale(0.95);
    background: rgba(24, 119, 242, 0.25);
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.stat-item .num {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    transition: color 0.2s ease;
}
.stat-item:hover .num {
    color: var(--primary);
}
.stat-item .label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color 0.2s ease;
}
.stat-item:hover .label {
    color: var(--text-main);
}
body.light-mode .stat-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
body.light-mode .stat-item:hover {
    background: rgba(24, 119, 242, 0.08);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.15);
}
body.light-mode .stat-item:active {
    background: rgba(24, 119, 242, 0.18);
}
.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px;
}
.profile-menu h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 16px 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-main);
    transition: background-color 0.2s;
}
.menu-item:hover {
    background-color: var(--primary-light);
}
.menu-label-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
}
.menu-label-wrapper svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}
.menu-item .arrow {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}
.toggle-item {
    cursor: default;
}
.toggle-item:hover {
    background-color: transparent;
}
/* Switch & Slider styles */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

body.light-mode .slider {
    background-color: #cbd5e1;
}
body.light-mode .slider:before {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
body.light-mode input:checked + .slider {
    background-color: var(--primary-color, #1877f2);
}
body.light-mode input:checked + .slider:before {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ==========================================================================
   INFO VIEW COMPONENT STYLES
   ========================================================================== */
.info-categories {
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
}
.info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}
.info-card:last-child {
    border-bottom: none;
}
.info-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.info-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.info-content h3 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
}
.info-content p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   VISA TIMELINE TRACKER COMPONENT STYLES
   ========================================================================== */
.visa-timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.light-mode .visa-timeline-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

body:not(.light-mode) .visa-timeline-card {
    background: var(--bg-card, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.visa-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.visa-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 0;
    flex: 1;
}

.visa-avatar {
    width: 36px;
    height: 36px;
    font-size: 15px;
    flex-shrink: 0;
}

.visa-author-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.visa-author-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.visa-post-time {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
}

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

.visa-stamp-badge {
    background: var(--primary, #1877f2);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(24, 119, 242, 0.25);
}

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

.visa-options-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

body:not(.light-mode) .visa-options-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.visa-timeline-track {
    position: relative;
    padding-left: 26px;
    margin-top: 4px;
    margin-bottom: 2px;
}

.visa-timeline-track::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-left: 2px dashed rgba(148, 163, 184, 0.4);
}

body.light-mode .visa-timeline-track::before {
    border-left-color: #cbd5e1;
}

body:not(.light-mode) .visa-timeline-track::before {
    border-left-color: rgba(255, 255, 255, 0.15);
}

.visa-step-item {
    position: relative;
    margin-bottom: 16px;
}

.visa-step-item:last-child {
    margin-bottom: 0;
}

.visa-step-dot {
    position: absolute;
    left: -25px;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    box-sizing: border-box;
}

body.light-mode .visa-step-dot {
    border-color: #ffffff;
}

body:not(.light-mode) .visa-step-dot {
    border-color: var(--bg-card, #1e293b);
}

.visa-step-dot.job-start {
    background: #f59e0b;
}

.visa-step-dot.applied {
    background: #1877f2;
}

.visa-step-dot.approved {
    background: #1877f2;
}

.visa-step-dot.delivered {
    background: #10b981;
}

.visa-step-label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.visa-step-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

.visa-step-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.visa-completed-badge {
    background: rgba(24, 119, 242, 0.12);
    color: var(--primary, #1877f2);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.visa-sub-note {
    font-size: 12px;
    color: var(--text-muted);
}

.visa-timeline-notes {
    margin-top: 4px;
    padding: 10px 14px;
    background: rgba(24, 119, 242, 0.04);
    border: 1px solid rgba(24, 119, 242, 0.15);
    border-left: 3px solid var(--primary, #1877f2);
    border-radius: 0 10px 10px 0;
    font-size: 12.5px;
    color: var(--text-main);
    line-height: 1.45;
    font-style: italic;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

body.light-mode .visa-timeline-notes {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.06);
    border-left-color: var(--primary, #1877f2);
    color: #334155;
}

/* ==========================================================================
   MESSAGING LIST VIEW STYLES
   ========================================================================== */
.chat-list {
    display: flex;
    flex-direction: column;
}
.chat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}
.chat-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}
.chat-row-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid var(--border-color);
}
.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
}
.chat-row-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}
.chat-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-row-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}
.chat-row-time {
    font-size: 11px;
    color: var(--text-muted);
}
.chat-row-msg-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.chat-row-preview {
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}
.chat-row-unread {
    background-color: var(--primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 16px;
    text-align: center;
}

/* ==========================================================================
   EXPLORE SCREEN COMPONENT STYLES
   ========================================================================== */
.explore-tags-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}
.explore-tags-container h3,
.explore-categories-grid h3:not(#lblMarketplace) {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.marketplace-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 0 0 14px 0;
    margin-bottom: 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

body.light-mode .marketplace-hero-header {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.marketplace-brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.marketplace-brand-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #10b981 0%, #1877f2 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.marketplace-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

#lblMarketplace.marketplace-main-heading {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    letter-spacing: -0.35px !important;
    text-transform: none !important;
    line-height: 1.2 !important;
    color: var(--text-main, #f8fafc) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.light-mode #lblMarketplace.marketplace-main-heading {
    color: #0f172a !important;
}

#marketplaceFilterResetMiniBtn:active {
    transform: scale(0.92);
    background: rgba(239, 68, 68, 0.24) !important;
}

#marketplaceFilterToggleBtn:active {
    transform: scale(0.95);
}

.marketplace-total-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    line-height: 1.2;
}

body.light-mode .marketplace-total-pill {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.marketplace-sub-heading {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
    flex-shrink: 0;
}
.explore-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.explore-tags .tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.explore-tags .tag:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-1px);
}
body.light-mode .explore-tags .tag {
    background: rgba(0, 0, 0, 0.02);
}
body.light-mode .explore-tags .tag:hover {
    background: var(--primary-light);
}

.explore-categories-grid {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}
.explore-categories-grid .grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.explore-categories-grid .grid-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.22s ease;
}
.explore-categories-grid .grid-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.explore-categories-grid .grid-item .icon {
    font-size: 28px;
}
.explore-categories-grid .grid-item .title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}

/* ==========================================================================
   RESPONSIVE DESIGN (NATIVE MOBILE MODE DETECTION)
   ========================================================================== */
@media (max-width: 850px) {
    .left-panel {
        display: none !important;
    }
    
    body {
        align-items: stretch;
        background-color: var(--bg-dark);
    }
    
    .app-container {
        padding: 0;
        height: 100vh;
        justify-content: center;
    }

    .simulator-container {
        flex: 1;
        width: 100%;
        height: 100%;
    }

    .iphone-frame {
        width: 100vw;
        height: 100vh;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .iphone-frame::after {
        display: none;
    }

    .dynamic-island {
        display: none !important;
    }

    .speaker {
        display: none !important;
    }

    .status-bar {
        display: none !important;
    }
}

/* ==========================================================================
   CIRCULAR AVATARS & PUBLIC PROFILE STYLES
   ========================================================================== */
.author-avatar,
.profile-avatar,
.profile-avatar-container,
.chat-avatar,
.chat-row-avatar,
.public-profile-avatar-container,
.profile-pic-preview-container {
    border-radius: 50% !important;
    overflow: hidden !important;
    aspect-ratio: 1 / 1 !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    -webkit-touch-callout: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
}

.author-avatar img,
.profile-avatar img,
.profile-avatar-container img,
.chat-avatar img,
.chat-row-avatar img,
.public-profile-avatar-container img,
.profile-pic-preview-container img {
    border-radius: 50% !important;
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    -webkit-touch-callout: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
    pointer-events: none !important;
}

.public-profile-avatar-container:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   STAMP FILTER TABS STYLING (DARK & LIGHT MODE)
   ========================================================================== */
.stamp-filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px 2px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.stamp-filter-tabs::-webkit-scrollbar {
    display: none;
}

.stamp-tab {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.light-mode .stamp-tab {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #475569;
}

.stamp-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

body.light-mode .stamp-tab:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

.stamp-tab.active {
    background: var(--primary-color, #1877f2) !important;
    color: #ffffff !important;
    border-color: var(--primary-color, #1877f2) !important;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

/* ==========================================================================
   SWIPEABLE IMAGE CAROUSEL FOR MULTI-PHOTO POSTS (INSTAGRAM STYLE)
   ========================================================================== */
.post-carousel-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    background: #000;
}

.post-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.post-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

.post-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-counter-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    z-index: 5;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.carousel-dots-container {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
    pointer-events: none;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: var(--primary-color, #1877f2);
    width: 14px;
    border-radius: 4px;
}




/* Theme Selector Segments */
.theme-selector-segments {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    padding: 2px;
}
.theme-segment {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.theme-segment.active {
    background: var(--bg-card);
    color: var(--primary-color, #1877f2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.theme-segment:hover:not(.active) {
    color: var(--text-color);
}

/* Top Background Upload Progress Pill */
.top-upload-banner {
    position: fixed;
    top: calc(env(safe-area-inset-top, 44px) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    max-width: 90vw;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.top-upload-banner.status-success {
    border-color: rgba(34, 197, 94, 0.6);
    background: rgba(20, 83, 45, 0.94);
}
.top-upload-banner.status-error {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(127, 29, 29, 0.94);
}
.top-upload-spinner {
    width: 15px;
    height: 15px;
    border: 2.2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: topUploadSpin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes topUploadSpin {
    to { transform: rotate(360deg); }
}
#topUploadCancelBtn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
}

/* Light Mode overrides for Top Upload Banner & Spinner Icon */
body.light-mode .top-upload-banner {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(24, 119, 242, 0.35);
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(24, 119, 242, 0.12);
}
body.light-mode .top-upload-banner.status-success {
    background: rgba(240, 253, 244, 0.98);
    border-color: rgba(22, 163, 74, 0.45);
    color: #15803d;
}
body.light-mode .top-upload-banner.status-error {
    background: rgba(254, 242, 242, 0.98);
    border-color: rgba(220, 38, 38, 0.45);
    color: #b91c1c;
}
body.light-mode .top-upload-spinner {
    border: 2.4px solid rgba(24, 119, 242, 0.18);
    border-top-color: #1877f2;
}
body.light-mode #topUploadCancelBtn {
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
}

/* Ensure Fullscreen Video receives native iOS center control touches (-10s, Play/Pause, +10s) */
video.lightbox-slide,
#lightboxVideo {
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

/* Inline Feed Video Wrapper & Centered Play Overlay */
.post-image-collage-grid.one-image.post-video-wrapper {
    aspect-ratio: unset !important;
    height: 320px !important;
    max-height: 320px !important;
    background: #0b101b;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}
.post-video-wrapper .feed-inline-video {
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: contain;
    display: block;
    background: #0b101b;
}
.inline-video-center-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    transition: opacity 0.2s ease;
}
.post-video-wrapper.is-playing .inline-video-center-play {
    opacity: 0;
    pointer-events: none;
}
.inline-video-play-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: #ffffff;
    font-size: 22px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}
.inline-video-expand-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 6;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}




/* ACTION SHEET CSS */
.action-sheet-overlay.active {
    opacity: 1 !important;
}
.action-sheet-overlay.active .action-sheet {
    transform: translateY(0) !important;
}
.action-sheet-btn:active {
    transform: scale(0.98);
    opacity: 0.8;
}
/* Action Sheet Styles */
.action-sheet {
    background: var(--bg-card);
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-sheet-handle {
    width: 40px;
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    margin: -10px auto 10px;
}

.action-sheet-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.action-sheet-btn:active {
    background: var(--primary-light);
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-content: start !important;
    align-items: start !important;
    grid-auto-rows: max-content !important;
    gap: 12px;
}

.marketplace-card {
    height: auto !important;
    align-self: start !important;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.marketplace-card:active {
    transform: scale(0.98);
}

.marketplace-card.pinned {
    border-color: rgba(59, 130, 246, 0.45) !important;
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.18) !important;
    position: relative;
}

body.light-mode .marketplace-card.pinned {
    border-color: rgba(37, 99, 235, 0.35) !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12) !important;
}

.mp-pinned-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92) 0%, rgba(99, 102, 241, 0.92) 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    pointer-events: none;
}

body.light-mode .mp-pinned-badge {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(79, 70, 229, 0.95) 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.mp-detail-pin-btn {
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary, #1877f2);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.18s ease;
}

.mp-detail-pin-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

.mp-detail-pin-btn.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.45);
    color: #3b82f6;
}

body.light-mode .mp-detail-pin-btn {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
    color: #2563eb;
}

body.light-mode .mp-detail-pin-btn.active {
    background: rgba(37, 99, 235, 0.16);
    color: #1d4ed8;
}

/* ==========================================================================
   Marketplace Fullscreen Filter View
   ========================================================================== */
.mp-filter-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 100000;
    background: var(--bg-dark, #0b1120);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInModal 0.18s ease-out;
}

body.light-mode .mp-filter-fullscreen {
    background: var(--bg-dark, #f8fafc);
}

.mp-filter-header {
    padding-top: max(env(safe-area-inset-top, 24px), 24px);
    padding-bottom: 14px;
    padding-left: 18px;
    padding-right: 18px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    z-index: 10;
}

.mp-filter-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.mp-filter-nav-btn:active {
    transform: scale(0.92);
}

.mp-filter-header-center {
    flex: 1;
    text-align: center;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mp-filter-header-title {
    font-size: 17.5px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.mp-filter-header-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 3px;
    max-width: 230px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-filter-reset-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red, #ef4444);
    border: 1px solid rgba(239, 68, 68, 0.22);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.mp-filter-reset-header-btn:active {
    transform: scale(0.94);
    background: rgba(239, 68, 68, 0.18);
}

.mp-filter-scroll-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 24px 20px 36px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.mp-filter-scroll-body::-webkit-scrollbar {
    display: none;
}

.mp-filter-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mp-filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mp-filter-section-title {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}

.mp-filter-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.mp-filter-icon-badge.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.mp-filter-icon-badge.badge-blue {
    background: rgba(24, 119, 242, 0.15);
    color: var(--primary-color, #1877f2);
}

.mp-filter-icon-badge.badge-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.mp-filter-icon-badge.badge-purple {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.mp-filter-currency-badge {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 700;
    background: var(--bg-card);
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mp-filter-price-inputs-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.mp-filter-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.mp-filter-input-prefix {
    position: absolute;
    left: 14px;
    font-size: 15px;
    font-weight: 800;
    color: #10b981;
    pointer-events: none;
}

.mp-filter-price-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 32px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 700;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mp-filter-price-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.mp-filter-price-sep {
    color: var(--text-muted);
    font-weight: 800;
    font-size: 16px;
}

.mp-filter-presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.mp-filter-sort-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mp-sort-btn {
    min-height: 46px;
    height: 46px;
    padding: 0 4px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.mp-sort-btn:active {
    transform: scale(0.96);
}

.mp-sort-btn.active {
    border-color: var(--primary-color, #1877f2);
    background: rgba(24, 119, 242, 0.18);
    color: var(--primary-color, #1877f2);
}

.mp-sort-btn-icon {
    font-size: 13.5px;
    flex-shrink: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mp-sort-btn-text {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mp-filter-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mp-filter-condition-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mp-filter-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px calc(14px + max(env(safe-area-inset-bottom, 16px), 16px)) 18px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
}

.mp-filter-footer-reset-btn {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mp-filter-footer-reset-btn:active {
    transform: scale(0.97);
}

.mp-filter-footer-apply-btn {
    flex: 2;
    height: 50px;
    border-radius: 14px;
    background: var(--primary-color, #1877f2);
    color: #fff;
    border: none;
    font-size: 15.5px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.4);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.mp-filter-footer-apply-btn:active {
    transform: scale(0.98);
    filter: brightness(0.94);
}

/* ==========================================================================
   NestLink Glow-Line Neon Icon Engine (Style 3A)
   Ultra-thin 1.5px/2px vector icons with ambient neon backlights.
   ========================================================================== */

.glow-icon {
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
    will-change: transform, filter;
}

/* Category buttons glow animation */
.category-btn .glow-icon {
    margin-right: 2px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.category-btn:hover .glow-icon {
    transform: scale(1.18);
}

.category-btn.active .glow-icon {
    transform: scale(1.12);
    filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 14px rgba(255, 255, 255, 0.6)) !important;
    stroke: #ffffff !important;
}

/* Info card hover glow */
.info-card:hover .info-icon .glow-icon {
    transform: scale(1.14) rotate(-3deg);
    filter: drop-shadow(0 0 10px currentColor);
}

/* In-App Notification Banner Aesthetics */
#inAppNotificationBanner {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#inAppNotificationBanner:hover {
    border-color: rgba(255, 255, 255, 0.24) !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7), 0 0 32px rgba(6, 182, 212, 0.22) !important;
}

#inAppNotificationBanner:active {
    transform: scale(0.985);
}

.glow-badge-wrapper {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#inAppNotificationBanner:hover .glow-badge-wrapper {
    transform: scale(1.06);
}

/* Post card category badge */
.header-category-tag .glow-icon {
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.header-category-tag:hover .glow-icon {
    opacity: 1;
    transform: scale(1.15);
}



