/* ============================================
   Variables & Resets
   ============================================ */
:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1b2e;
    --bg-card: #1e1f35;
    --bg-input: #2a2b45;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --ai-glow-color: #a78bfa;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #374151;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
    --header-height: 60px;
    --bottom-bar-height: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --app-height: 100vh;
}

@supports (height: 100dvh) {
    :root { --app-height: 100dvh; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: var(--app-height);
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans Arabic', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.55;
    height: var(--app-height);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.app-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* ============================================
   Rotating Border Glow
   ============================================ */
@keyframes rotateBorderGlow {
    0% {
        box-shadow: 0 0 6px 1px var(--ai-glow-color),
                    inset 4px 0 8px -4px var(--ai-glow-color),
                    inset -4px 0 8px -4px transparent;
        border-color: rgba(167, 139, 250, 0.7);
    }
    25% {
        box-shadow: 0 0 8px 2px var(--ai-glow-color),
                    inset 0 4px 8px -4px var(--ai-glow-color),
                    inset 0 -4px 8px -4px transparent;
        border-color: rgba(167, 139, 250, 0.8);
    }
    50% {
        box-shadow: 0 0 8px 2px var(--ai-glow-color),
                    inset -4px 0 8px -4px var(--ai-glow-color),
                    inset 4px 0 8px -4px transparent;
        border-color: rgba(167, 139, 250, 0.9);
    }
    75% {
        box-shadow: 0 0 8px 2px var(--ai-glow-color),
                    inset 0 -4px 8px -4px var(--ai-glow-color),
                    inset 0 4px 8px -4px transparent;
        border-color: rgba(167, 139, 250, 0.8);
    }
    100% {
        box-shadow: 0 0 6px 1px var(--ai-glow-color),
                    inset 4px 0 8px -4px var(--ai-glow-color),
                    inset -4px 0 8px -4px transparent;
        border-color: rgba(167, 139, 250, 0.7);
    }
}

/* ============================================
   Sidebar (Desktop)
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    z-index: 50;
    padding: 0.5rem 0;
    gap: 0.2rem;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    padding: 0.5rem 1rem;
    padding-top: calc(0.5rem + var(--safe-top));
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1rem;
    margin: 0 0.5rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 2px solid transparent;
    white-space: nowrap;
    position: relative;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

.sidebar-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.sidebar-btn.active {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    border-color: rgba(99, 102, 241, 0.4);
}

.sidebar-btn.ai-glow.active {
    animation: rotateBorderGlow 2.5s linear infinite;
    background: rgba(139, 92, 246, 0.2);
    color: white;
    border: 2px solid rgba(167, 139, 250, 0.7);
}

.sidebar-btn ion-icon {
    font-size: 1.2rem;
    --ionicon-stroke-width: 32px;
    flex-shrink: 0;
}

.sidebar-divider {
    border-top: 1px solid var(--border);
    margin: 0.3rem 0.8rem;
}

.sidebar-section-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0.3rem 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    flex-shrink: 0;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    margin: 0 0.8rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
    transition: var(--transition);
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

.new-chat-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: white;
}

.chat-history-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid transparent;
    flex-shrink: 0;
}

.chat-history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.chat-history-item.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    color: white;
}

.chat-history-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chat-history-delete {
    opacity: 0;
    cursor: pointer;
    color: var(--error);
    font-size: 0.9rem;
    transition: 0.2s;
    flex-shrink: 0;
}

.chat-history-item:hover .chat-history-delete {
    opacity: 1;
}

/* ============================================
   Header
   ============================================ */
.app-header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    padding-top: var(--safe-top);
    flex-shrink: 0;
    z-index: 100;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    min-width: 0;
    flex-shrink: 1;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.65rem;
    color: var(--text-muted);
    direction: ltr;
    unicode-bidi: embed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.header-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.35rem 0.8rem;
    border-radius: 40px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* ============================================
   Admin Bar
   ============================================ */
.admin-bar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 0.35rem 1rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: white;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
    min-height: 30px;
}

/* ============================================
   Mode Tabs (Mobile)
   ============================================ */
.mode-tabs {
    display: none;
    gap: 0.5rem;
    padding: 0.6rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
    white-space: nowrap;
}

.mode-tabs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.mode-tab {
    flex-shrink: 0;
    padding: 0.55rem 1rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.mode-tab ion-icon {
    font-size: 1rem;
    --ionicon-stroke-width: 32px;
}

.mode-tab.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary);
    color: white;
}

.mode-tab.ai-glow.active {
    animation: rotateBorderGlow 2.5s linear infinite;
    background: rgba(139, 92, 246, 0.25);
    color: white;
    border: 2px solid rgba(167, 139, 250, 0.7);
}

.mode-tab:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
    position: relative;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.main-content.no-scroll {
    overflow: hidden;        /* used by group chat to handle scrolling itself */
}

.mode-content {
    padding: 0.5rem 1rem;
    min-height: 100%;
    padding-bottom: calc(1rem + var(--safe-bottom));
}

/* ============================================
   Sticky Back Bar (Chat conversation)
   ============================================ */
.sticky-back-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.sticky-back-bar .btn-back {
    padding: 0.4rem 0.9rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.btn-back:hover {
    background: rgba(239, 68, 68, 0.2);
}

.conversation-title {
    flex: 1;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ============================================
   Bottom Bar
   ============================================ */
.bottom-bar {
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 80;
    transition: height 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-bottom);
}

.bottom-bar-inner {
    padding: 0.5rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--bottom-bar-height);
    flex-wrap: nowrap;
}

.bottom-bar.chat-bar .bottom-bar-inner {
    min-height: 58px;
    align-items: flex-end;
}

/* ============================================
   Chat Input (common)
   ============================================ */
.chat-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    background: var(--bg-input);
    border-radius: 28px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    transition: var(--transition);
    min-height: 44px;
    max-height: 120px;
}

.chat-input-wrap:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    resize: none;
    outline: none;
    padding: 0.4rem 0.5rem;
    font-family: inherit;
    line-height: 1.4;
    max-height: 100px;
    min-height: 28px;
    overflow-y: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
}

.chat-textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.file-preview-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    color: var(--text-primary);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.file-preview-chip img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.file-preview-chip .remove-file {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.file-preview-chip .remove-file:hover {
    color: var(--error);
}

/* Action buttons (mic, settings, etc.) */
.input-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 1.2rem;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.input-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.input-action-btn.recording {
    color: var(--error);
    animation: pulse-rec 1.2s infinite;
}

.input-action-btn.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.2);
}

@keyframes pulse-rec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 1.2rem;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.uploading-indicator {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 0.5rem;
    white-space: nowrap;
}

/* Attach button */
.attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    transition: var(--transition);
}

.attach-btn:hover {
    background: var(--accent-primary);
    color: white;
}

/* ============================================
   Amval Search
   ============================================ */
.search-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.search-row input {
    padding: 0.55rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 40px;
    color: var(--text-primary);
    font-size: 0.85rem;
    direction: ltr;
    text-align: left;
    min-width: 60px;
    flex: 1 1 80px;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.search-row input.name-input {
    flex: 2 1 140px;
}

.search-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.search-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 40px;
    padding: 0.55rem 1.2rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.clear-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 40px;
    padding: 0.55rem 0.9rem;
    color: #f87171;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ============================================
   Aradeh Pills
   ============================================ */
.pills-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.3rem 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
    flex-wrap: nowrap;
}

.pills-row::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    flex-shrink: 0;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid rgba(99, 102, 241, 0.25);
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.pill-btn.active {
    background: rgba(139, 92, 246, 0.45);
    border-color: rgba(139, 92, 246, 0.7);
    color: white;
}

.pill-btn:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.5);
}

.pill-back {
    flex-shrink: 0;
    padding: 0.55rem 1rem;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    background: rgba(239, 68, 68, 0.12);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.pill-back:hover {
    background: rgba(239, 68, 68, 0.22);
}

/* ============================================
   Chat Messages (common to AI and group)
   ============================================ */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem 0;
}

.message-row {
    display: flex;
    width: 100%;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.ai {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 82%;
    padding: 0.6rem 0.9rem;
    border-radius: 18px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

.message-row.user .message-bubble {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-bottom-left-radius: 6px;
}

.message-row.ai .message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-right-radius: 6px;
}

.message-time {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
    text-align: left;
    direction: ltr;
}

.message-row.ai .message-time {
    color: var(--text-muted);
}

.message-bubble pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.6rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    margin: 0.5rem 0;
    direction: ltr;
    text-align: left;
}

.message-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.message-bubble pre code {
    background: none;
    padding: 0;
}

.message-bubble ul,
.message-bubble ol {
    padding-right: 1.2rem;
    margin: 0.3rem 0;
}

.message-bubble img {
    max-width: 220px;
    max-height: 220px;
    border-radius: 10px;
    margin-top: 0.3rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 0.9rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent-primary);
    margin-right: 2px;
    vertical-align: text-bottom;
    animation: blinkCursor 0.8s step-end infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   Cards Grid (Amval & Aradeh)
   ============================================ */
.cards-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 1fr;
    margin-top: 0.5rem;
}

@media (min-width: 540px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
    background: var(--bg-card);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius);
    padding: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    word-break: break-word;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    border-right: 3px solid var(--accent-primary);
    padding-right: 0.6rem;
}

.card .codes-section {
    margin: 0.4rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.code-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border);
    padding: 0.1rem 0;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.code-item strong {
    font-family: 'JetBrains Mono', monospace;
    direction: ltr;
    unicode-bidi: embed;
    font-size: 0.9rem;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

.copy-btn:hover {
    color: var(--accent-primary);
}

.display-price,
.display-taxrate {
    color: var(--success);
    font-weight: 700;
    direction: ltr;
    unicode-bidi: embed;
}

.unit-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 0.12rem 0.5rem;
    border-radius: 50px;
    font-size: 0.6rem;
    font-weight: 600;
    display: inline-block;
}

.input-group {
    margin: 0.4rem 0;
}

.input-group label {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-bottom: 0.1rem;
}

.input-group input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-size: 0.78rem;
    direction: ltr;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Generic button styles */
.btn {
    width: 100%;
    padding: 0.55rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.4rem;
    transition: 0.2s;
    font-size: 0.8rem;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.btn:hover { opacity: 0.9; }

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    width: auto;
    display: inline-block;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.taxResult {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-xs);
    padding: 0.5rem;
    margin-top: 0.4rem;
    border-right: 3px solid var(--success);
    font-size: 0.75rem;
}

.taxResult p {
    display: flex;
    justify-content: space-between;
    margin: 0.15rem 0;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.tax-value {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--success);
    direction: ltr;
    unicode-bidi: embed;
}

.tax-value1 {
    font-weight: 600;
    font-size: 1rem;
    color: var(--warning);
    direction: ltr;
    unicode-bidi: embed;
}

/* ============================================
   Calculator
   ============================================ */
.calc-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.2rem;
    border: 1px solid var(--border);
}

.calc-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.calc-tabs::-webkit-scrollbar { display: none; }

.calc-tab-btn {
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.calc-tab-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.radio-group label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

/* ============================================
   Modals
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: 24px;
    width: 92%;
    max-width: 480px;
    padding: 1.5rem;
    max-height: calc(88 * var(--app-height) / 100);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.image-preview img {
    max-width: 100%;
    max-height: 55vh;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* ============================================
   Empty / Loading States
   ============================================ */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================
   Scroll to Bottom Button
   ============================================ */
.scroll-bottom-btn {
    position: sticky;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    opacity: 0.9;
    -webkit-appearance: none;
    appearance: none;
    font-size: 1.3rem;
    animation: fadeInUp 0.3s ease-out;
}

.scroll-bottom-btn:hover {
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.6);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 0.9; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   Dictation Tooltip
   ============================================ */
.dictation-tip {
    position: absolute;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%);
    background: #2d2f45;
    color: #f8fafc;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 200;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    border: 1px solid var(--border);
}

.dictation-fallback-btn {
    position: relative;
}

/* ============================================
   AI Settings Panel
   ============================================ */
.chat-settings-panel {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.7rem;
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chat-settings-panel label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.chat-settings-panel input[type=range] {
    flex: 1;
    accent-color: var(--accent-primary);
}

/* ============================================
   Product Card inside Chat (mini)
   ============================================ */
.product-card-mini {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.4rem;
    font-size: 0.7rem;
}

.product-card-mini strong {
    font-size: 0.75rem;
}

.product-card-mini .code-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.15rem 0;
}

.product-card-mini .copy-btn {
    font-size: 0.7rem;
}

.product-card-mini input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.3rem;
    color: white;
    font-size: 0.65rem;
    direction: ltr;
    margin-top: 0.2rem;
}

.product-card-mini .btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.2rem;
}

/* ============================================
   Group Chat Specific Styles
   ============================================ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.unread-badge {
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    border-radius: 10px;
    padding: 0.1rem 0.35rem;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    display: none;
    pointer-events: none;
}

.unread-badge.show {
    display: inline-block;
}

.group-active {
    background: #10b98133;
    border-color: #10b981;
    color: white;
}

.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}

.empty-chat ion-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    opacity: 0.6;
}

.msg-sender {
    display: block;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--accent-primary);
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.msg-attachment {
    margin-top: 0.5rem;
}

.msg-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font-size: 0.8rem;
}

.file-link ion-icon {
    font-size: 1.3rem;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.reply-preview-bar,
.file-preview-bar {
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 40px;
}

.reply-preview-content,
.file-preview-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.preview-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
}

.reply-preview-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}

.file-preview-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.file-preview-info {
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    min-width: 0;
    flex: 1;
}

.file-preview-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-status {
    color: var(--text-muted);
}

.floating-reply-btn {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0.95;
    transition: var(--transition);
}

.red-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid white;
}

.message-row.swipe-active .message-bubble {
    transform: translateX(12px);
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.reply-bubble-btn {
    position: absolute;
    bottom: 4px;
    left: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: inherit;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 5;
}

.message-bubble:hover .reply-bubble-btn {
    opacity: 1;
    visibility: visible;
}

@media (hover: none) {
    .reply-bubble-btn { display: none !important; }
}

/* Lazy image placeholder */
.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 150px;
    background: linear-gradient(135deg, #2a2b45, #1e1f35);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 0.5rem;
    border: 1px dashed var(--border);
    transition: var(--transition);
}

.image-placeholder:hover {
    background: linear-gradient(135deg, #3a3b55, #2a2b45);
    color: var(--text-primary);
}

.image-placeholder ion-icon {
    font-size: 2rem;
    opacity: 0.7;
}

/* ============================================
   Responsive: Desktop
   ============================================ */
@media (min-width: 769px) {
    .sidebar {
        display: flex !important;
    }
    .mode-tabs {
        display: none !important;
    }
}

/* ============================================
   Responsive: Tablet & Mobile (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
    .mode-tabs {
        display: flex !important;
    }
    .app-header {
        padding: 0 0.7rem;
    }
    .user-name {
        font-size: 0.8rem;
    }
    .user-email {
        font-size: 0.6rem;
    }
    .avatar {
        width: 34px;
        height: 34px;
        font-size: 1.3rem;
    }
    .header-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.72rem;
    }
    .bottom-bar-inner {
        padding: 0.5rem 0.6rem;
        gap: 0.4rem;
    }
    .chat-input-wrap {
        border-radius: 24px;
        padding: 0.25rem 0.4rem;
        min-height: 40px;
    }
    .chat-textarea {
        font-size: 0.85rem;
    }
    .send-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .input-action-btn {
        width: 33px;
        height: 33px;
        font-size: 1.1rem;
    }
    .search-row input {
        font-size: 0.8rem;
        padding: 0.5rem 0.7rem;
    }
    .search-btn,
    .clear-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.9rem;
    }
    .card {
        padding: 0.85rem;
    }
    .card h3 {
        font-size: 0.9rem;
    }
    .message-bubble {
        max-width: 88%;
        font-size: 0.85rem;
        padding: 0.55rem 0.75rem;
    }
    .file-preview-chip {
        max-width: 130px;
    }
    .pill-btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.9rem;
    }
    .pill-back {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }
    .mode-tab {
        padding: 0.55rem 1rem;
        font-size: 0.8rem;
    }
    .mode-tab ion-icon {
        font-size: 1.1rem;
    }
    .sticky-back-bar {
        padding: 0.4rem 0.7rem;
    }
    .sticky-back-bar .btn-back {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }
    .conversation-title {
        font-size: 0.85rem;
    }
    .search-container {
        gap: 0.4rem;
    }
    .search-row {
        gap: 0.4rem;
    }
}

/* ============================================
   Responsive: Small Mobile (≤400px)
   ============================================ */
@media (max-width: 400px) {
    .header-btn span:not(.ionicon) {
        display: none;
    }
    .header-btn {
        padding: 0.4rem;
        font-size: 1rem;
    }
    .header-btn ion-icon {
        margin: 0;
    }
    .pill-btn {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }
    .pill-back {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    .sticky-back-bar .btn-back {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    .conversation-title {
        font-size: 0.78rem;
    }
    .search-container {
        gap: 0.35rem;
    }
    .search-row {
        gap: 0.35rem;
    }
    .search-row input {
        font-size: 0.75rem;
        padding: 0.45rem 0.55rem;
        min-width: 45px;
        flex: 1 1 60px;
    }
    .search-row input.name-input {
        flex: 2 1 100px;
    }
    .search-btn,
    .clear-btn {
        font-size: 0.75rem;
        padding: 0.45rem 0.7rem;
    }
    .message-bubble {
        max-width: 92%;
        font-size: 0.82rem;
        padding: 0.5rem 0.65rem;
    }
    .file-preview-chip {
        max-width: 100px;
        font-size: 0.65rem;
    }
    .file-preview-chip img {
        width: 22px;
        height: 22px;
    }
    .mode-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.78rem;
    }
    .mode-tab ion-icon {
        font-size: 1rem;
    }
    .bottom-bar-inner {
        padding: 0.4rem 0.5rem;
        gap: 0.3rem;
    }
    .chat-input-wrap {
        border-radius: 22px;
        padding: 0.2rem 0.35rem;
        min-height: 36px;
    }
    .chat-textarea {
        font-size: 0.8rem;
        padding: 0.3rem 0.4rem;
    }
    .send-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .input-action-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    .user-name {
        font-size: 0.75rem;
    }
    .user-email {
        font-size: 0.55rem;
    }
    .avatar {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    .card {
        padding: 0.7rem;
    }
    .card h3 {
        font-size: 0.82rem;
    }
    .code-item {
        font-size: 0.78rem;
    }
    .code-item strong {
        font-size: 0.8rem;
    }
}

/* ============================================
   Responsive: Extra Small (≤340px)
   ============================================ */
@media (max-width: 340px) {
    .mode-tabs {
        padding: 0.4rem;
        gap: 0.3rem;
    }
    .mode-tab {
        padding: 0.4rem 0.65rem;
        font-size: 0.68rem;
        border-radius: 30px;
    }
    .mode-tab ion-icon {
        font-size: 0.9rem;
    }
    .mode-tab span {
        display: none;
    }
    .mode-tab ion-icon {
        margin: 0;
    }
    .search-row input {
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
    }
    .search-btn,
    .clear-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
    .pill-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.78rem;
    }
}

/* ============================================
   Safari / iOS Fixes
   ============================================ */
@supports (-webkit-touch-callout: none) {
    body {
        position: fixed;
        width: 100%;
    }
    .main-content {
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
    }
    .sidebar {
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
    }
    .mode-tabs {
        -webkit-overflow-scrolling: touch;
    }
    .pills-row {
        -webkit-overflow-scrolling: touch;
    }
    .app-layout {
        display: -webkit-flex;
        display: flex;
    }
    .main-panel {
        display: -webkit-flex;
        display: flex;
        -webkit-flex-direction: column;
        flex-direction: column;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        position: static;
        overflow: visible;
    }
    .sidebar,
    .mode-tabs,
    .bottom-bar,
    .app-header,
    .admin-bar,
    .sticky-back-bar {
        display: none !important;
    }
    .main-content {
        overflow: visible;
    }
}
.premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.premium-badge ion-icon {
    font-size: 0.65rem;
    color: white;
    --ionicon-stroke-width: 48px;
}
.verified-badge {
    color: #1d9bf0; /* Instagram/Twitter blue */
    font-size: 1.1em;
    margin-left: 4px;
    vertical-align: middle;
}
.premium-countdown {
    font-size: 0.85em;
    color: #f5a623;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}