:root {
    color-scheme: dark;
    --bg-deep: #060913;
    --bg-surface: #0B1120;
    --bg-elevated: #111827;
    --bg-card: rgba(17, 24, 39, 0.86);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --bg-input: #0F172A;
    --gold-primary: #D4AF37;
    --gold-light: #F3E5AB;
    --gold-gradient: linear-gradient(135deg, #F3E5AB 0%, #D4AF37 50%, #997517 100%);
    --crimson-accent: #9B1B30;
    --blue-accent: #38BDF8;
    --emerald-accent: #10B981;
    --danger-accent: #EF4444;
    --text-pure: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --border-subtle: rgba(212, 175, 55, 0.25);
    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-elevated: 0 14px 36px rgba(0, 0, 0, 0.45);
    --font-ar: 'Cairo', sans-serif;
    --font-scripture: 'Amiri', serif;
    --font-en: 'Plus Jakarta Sans', sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

[data-theme="light"] {
    color-scheme: light;
    --bg-deep: #FAF7F0;
    --bg-surface: #F3EFE6;
    --bg-elevated: #FFFFFF;
    --bg-card: rgba(255, 252, 246, 0.94);
    --bg-card-hover: rgba(248, 242, 230, 0.98);
    --bg-input: #FFFFFF;
    --gold-primary: #9A7211;
    --gold-light: #785506;
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #B58922 55%, #8C650D 100%);
    --crimson-accent: #8C182B;
    --blue-accent: #0284C7;
    --emerald-accent: #059669;
    --danger-accent: #DC2626;
    --text-pure: #1E1B18;
    --text-secondary: #3D362E;
    --text-muted: #665C4E;
    --text-dim: #8C8070;
    --border-subtle: rgba(175, 132, 35, 0.32);
    --border-glass: rgba(30, 27, 24, 0.1);
    --shadow-elevated: 0 12px 32px rgba(110, 85, 35, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-ar);
    background-color: var(--bg-deep);
    color: var(--text-pure);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.1) 0%, transparent 55%),
        radial-gradient(circle at 95% 90%, rgba(56, 189, 248, 0.05) 0%, transparent 45%);
    transition: background-color 0.25s ease, color 0.25s ease;
}

#app-layout {
    display: flex;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

/* Desktop Sidebar + Collapsible Support */
aside#sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 50;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), padding 0.28s ease, background 0.25s ease;
    flex-shrink: 0;
}

aside#sidebar.collapsed {
    width: 78px;
    padding: 18px 10px;
}

aside#sidebar.collapsed .brand-title,
aside#sidebar.collapsed .nav-item button span,
aside#sidebar.collapsed .user-details,
aside#sidebar.collapsed .pwa-install-btn span {
    display: none;
}

aside#sidebar.collapsed .nav-item button {
    justify-content: center;
    padding: 12px;
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 16px;
}

.brand-identity {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.22);
    flex-shrink: 0;
}

.brand-title h1 {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-pure);
    line-height: 1.15;
}

.brand-title span {
    font-size: 11px;
    color: var(--gold-primary);
    font-weight: 700;
}

.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--border-glass);
    background: rgba(212, 175, 55, 0.06);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.sidebar-collapse-btn:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-item button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--text-muted);
    font-family: var(--font-ar);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
}

.nav-item button i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.nav-item button:hover {
    color: var(--text-pure);
    background: rgba(212, 175, 55, 0.08);
}

.nav-item.active button {
    color: #060913;
    background: var(--gold-gradient);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.28);
    font-weight: 800;
}

.sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-mini-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 13px;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}
.user-mini-card:hover {
    border-color: var(--gold-primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gold-gradient);
    color: #060913;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
}

.user-details { flex: 1; overflow: hidden; }
.user-name {
    font-size: 13px; font-weight: 800; color: var(--text-pure);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-balance { font-size: 11.5px; color: var(--gold-primary); font-weight: 700; }

.pwa-install-btn {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--blue-accent);
    padding: 9px 12px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-ar);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

/* Main Content & Top Bar */
main#main-content {
    flex: 1;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

header#topbar {
    height: 64px;
    flex-shrink: 0;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-surface);
    z-index: 40;
}

.topbar-right, .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-right {
    min-width: 0;
    flex-shrink: 1;
}
.topbar-left {
    flex-shrink: 0;
}

.topbar-newchat-btn {
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid var(--border-subtle);
    color: var(--gold-primary);
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    font-family: var(--font-ar);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.topbar-newchat-btn:hover {
    background: var(--gold-gradient);
    color: #060913;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-pure);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.topbar-icon-btn:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}
.topbar-notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 9px;
    background: var(--danger-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-deep);
}

/* Views & Chat */
.view-section {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 22px;
}
.view-section.active {
    display: flex;
    flex-direction: column;
}

#view-chat {
    padding: 0;
    overflow: hidden;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    max-width: 82%;
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.78;
    position: relative;
    animation: fadeIn 0.28s ease;
}

.bubble-user {
    align-self: flex-start;
    background: var(--gold-gradient);
    color: #060913;
    font-weight: 700;
    border-bottom-right-radius: 5px;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.22);
}

.bubble-bot {
    align-self: flex-end;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-pure);
    border-bottom-left-radius: 5px;
    box-shadow: var(--shadow-elevated);
}

.bubble-bot blockquote {
    font-family: var(--font-scripture);
    font-size: 17px;
    border-right: 3px solid var(--gold-primary);
    padding: 8px 14px;
    margin: 10px 0;
    background: rgba(212, 175, 55, 0.06);
    border-radius: 8px;
    color: var(--gold-light);
}

.bubble-bot pre {
    background: rgba(0, 0, 0, 0.35);
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid var(--border-glass);
}

.bubble-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-glass);
}

.bubble-btn {
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-family: var(--font-ar);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 9px;
    transition: all 0.2s;
}
.bubble-btn:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.12);
}

/* Floating Glassmorphism Chat Composer */
.chat-attached-images-preview {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 24px 4px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-glass);
}
.chat-attached-images-preview.active { display: flex; }
.chat-attached-chip {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    border: 1.5px solid var(--gold-primary);
    overflow: hidden;
}
.chat-attached-chip img { width: 100%; height: 100%; object-fit: cover; }
.chat-attached-chip-remove {
    position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
    border-radius: 50%; background: var(--danger-accent); color: #fff;
    border: none; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.chat-input-bar {
    margin: 0 20px 14px;
    padding: 10px 14px;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    border: 1.5px solid var(--border-subtle);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-elevated);
}

.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-pure);
    font-family: var(--font-ar);
    font-size: 14.5px;
    padding: 8px 10px;
    outline: none;
    resize: none;
    height: 42px;
    max-height: 120px;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--gold-gradient);
    border: none;
    color: #060913;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}
.chat-send-btn:hover { transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Welcome Hero & Quick Starter Cards */
.chat-welcome-hero {
    margin: auto;
    max-width: 680px;
    padding: 32px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.35s ease;
}
.welcome-logo-img {
    width: 82px;
    height: 82px;
    border-radius: 22px;
    object-fit: cover;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 28px rgba(212, 175, 55, 0.3);
    margin-bottom: 16px;
}
.chat-welcome-hero h2 {
    font-size: 26px;
    font-weight: 900;
    color: var(--gold-primary);
    margin-bottom: 6px;
}
.chat-welcome-hero .scripture-verse {
    font-family: var(--font-scripture);
    font-size: 17px;
    color: var(--gold-light);
    margin-bottom: 8px;
}
.chat-welcome-hero p {
    font-size: 14.5px;
    color: var(--text-muted);
    margin-bottom: 22px;
}
.welcome-quick-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    width: 100%;
}
.welcome-prompt-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 12px 14px;
    color: var(--text-pure);
    font-family: var(--font-ar);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: right;
}
.welcome-prompt-chip:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.12);
    transform: translateY(-2px);
}

/* Upgraded Sunday Katameros Cards (#lesson-liturgy-card & #sermon-liturgy-card) */
.katameros-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.14) 0%, var(--bg-card) 100%);
    border: 1.5px solid var(--border-subtle);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-elevated);
}
.katameros-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.katameros-meta-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.katameros-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
}
.katameros-readings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.katameros-passage-chip {
    background: rgba(212, 175, 55, 0.07);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 8px 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.katameros-passage-chip:hover,
.katameros-passage-chip.active {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--gold-primary);
    transform: translateY(-1px);
}
.katameros-passage-label,
.katameros-passage-chip .chip-type {
    font-size: 11px;
    font-weight: 800;
    color: var(--gold-primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.katameros-passage-ref,
.katameros-passage-chip .chip-ref {
    font-family: var(--font-scripture);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-pure);
}

/* Feature Cards & Forms */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow-elevated);
    transition: all 0.25s ease;
}
.feature-card:hover {
    border-color: var(--border-subtle);
}

.form-group { margin-bottom: 15px; }
.form-label {
    display: block; font-size: 13px; font-weight: 800;
    color: var(--text-muted); margin-bottom: 7px;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-pure);
    font-family: var(--font-ar);
    padding: 11px 15px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

/* In-Place Transformable Dropdown / Custom Input Slot */
.transformable-field-slot {
    position: relative;
    width: 100%;
}
.transformable-custom-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.18s ease;
}
.transformable-custom-input {
    padding-left: 112px !important;
}
.transformable-back-btn {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.38);
    color: var(--gold-primary);
    border-radius: 8px;
    padding: 5px 10px;
    font-family: var(--font-ar);
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.transformable-back-btn:hover {
    background: var(--gold-gradient);
    color: #060913;
    border-color: var(--gold-primary);
}

.selection-chips-grid {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.selection-chip {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-pure);
    font-family: var(--font-ar);
    font-size: 13px;
    font-weight: 700;
    padding: 9px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.selection-chip:hover {
    border-color: var(--gold-primary);
}
.selection-chip.active {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    font-weight: 800;
}

.gold-btn {
    background: var(--gold-gradient);
    color: #060913;
    border: none;
    border-radius: 13px;
    padding: 12px 22px;
    font-family: var(--font-ar);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}
.gold-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212, 175, 55, 0.38); }
.gold-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Wallet & Timer */
.wallet-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.wallet-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.wallet-action-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold-primary);
}
.wallet-action-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 23px; flex-shrink: 0;
}

.timer-circle-box {
    width: 165px; height: 165px; border-radius: 50%;
    border: 6px solid rgba(212, 175, 55, 0.18);
    border-top-color: var(--gold-primary);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    animation: pulseGlow 2.5s infinite ease-in-out;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(212, 175, 55, 0.15); }
    50% { box-shadow: 0 0 28px rgba(212, 175, 55, 0.35); }
}

/* Recharge Method Selection & InstaPay Walkthrough Styles */
.recharge-method-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.recharge-method-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.22s ease;
}
.recharge-method-card:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-2px);
}
.recharge-method-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.instapay-walkthrough-box {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 16px;
    text-align: center;
}
.instapay-slide-img-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 6px 0 12px;
}
.instapay-guide-img {
    width: 100%;
    max-width: 380px;
    max-height: 540px;
    border-radius: 16px;
    object-fit: contain;
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.instapay-slide-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.instapay-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--border-glass);
    cursor: pointer;
    transition: all 0.25s ease;
}
.instapay-dot.active {
    width: 28px;
    background: #A78BFA;
}

.recharge-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 14px;
}
.recharge-step-num {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.18);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--gold-primary);
    font-weight: 900;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.instapay-info-step-card {
    background: rgba(167, 139, 250, 0.05);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 18px;
    padding: 16px;
}
.instapay-info-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Tools & Settings */
.tools-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
}
.tool-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.tool-action-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-3px);
}

.profile-header-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.14), var(--bg-card));
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.profile-avatar-box {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--gold-gradient); color: #060913;
    font-size: 26px; font-weight: 900;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.status-paid { background: rgba(212, 175, 55, 0.15); color: var(--gold-primary); border: 1px solid var(--gold-primary); }
.status-free { background: rgba(56, 189, 248, 0.12); color: var(--blue-accent); border: 1px solid rgba(56, 189, 248, 0.3); }
.status-expired { background: rgba(239, 68, 68, 0.12); color: var(--danger-accent); border: 1px solid rgba(239, 68, 68, 0.3); }

.settings-menu-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.setting-item-row {
    display: flex; align-items: center; gap: 14px; padding: 15px 18px;
    background: var(--bg-card); border: 1px solid var(--border-glass);
    border-radius: 16px; cursor: pointer; transition: all 0.2s ease;
}
.setting-item-row:hover { border-color: var(--gold-primary); transform: translateY(-1px); }
.setting-icon-box {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(212, 175, 55, 0.12); color: var(--gold-primary);
    display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.setting-text-box { flex: 1; }
.setting-text-box .setting-title { font-size: 15px; font-weight: 800; color: var(--text-pure); }
.setting-text-box .setting-subtitle { font-size: 12px; color: var(--text-muted); }

/* Modals, Auth, Notifications & Mobile Drawer */
.d-none { display: none !important; }
.password-input-group { position: relative; display: flex; align-items: center; }
.password-input-group .form-input { padding-left: 42px; }
.btn-toggle-pwd {
    position: absolute; left: 12px; background: transparent; border: none;
    color: var(--text-muted); cursor: pointer; font-size: 17px;
}
.pwd-strength-container { margin: 8px 0 14px; text-align: right; }
.pwd-strength-bar { height: 4px; width: 100%; background: var(--border-glass); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.pwd-strength-fill { height: 100%; width: 0%; transition: all 0.3s ease; }
.pwd-reqs-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 8px; font-size: 11px; color: var(--text-muted); }
.pwd-req-item { display: flex; align-items: center; gap: 5px; }
.pwd-req-item.valid { color: var(--emerald-accent); font-weight: 700; }

#auth-modal, #feedback-modal {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(12px);
    display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; overflow-y: auto;
}
#auth-modal.active, #feedback-modal.active { display: flex; }
.auth-card, .feedback-card {
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: 22px; width: 100%; max-width: 420px; padding: 24px 20px;
    box-shadow: var(--shadow-elevated); text-align: center;
}
.auth-logo-img { width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid var(--gold-primary); margin: 0 auto 10px; display: block; }
.btn-google-action {
    width: 100%; background: #FFF; color: #1F2937; border: 1px solid #E5E7EB;
    border-radius: 12px; padding: 10px 14px; font-family: var(--font-ar); font-size: 13px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
}
.auth-tabs-header {
    display: flex; background: rgba(212, 175, 55, 0.06); border: 1px solid var(--border-glass);
    border-radius: 12px; padding: 3px; margin-bottom: 14px;
}
.auth-tab-btn {
    flex: 1; padding: 8px 10px; border: none; background: transparent; color: var(--text-muted);
    font-family: var(--font-ar); font-size: 12.5px; font-weight: 700; border-radius: 9px; cursor: pointer;
}
.auth-tab-btn.active { background: var(--gold-gradient); color: #060913; font-weight: 800; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--text-muted); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-glass); }

.feedback-options { display: flex; gap: 10px; margin: 14px 0; }
.feedback-option-btn {
    flex: 1; padding: 10px; border-radius: 12px; background: var(--bg-card);
    border: 1px solid var(--border-glass); color: var(--text-pure); font-family: var(--font-ar);
    font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.feedback-option-btn.active { border-color: var(--gold-primary); color: var(--gold-primary); background: rgba(212, 175, 55, 0.14); }

/* Notification Popover */
.notif-dropdown-wrapper { position: relative; display: inline-flex; align-items: center; }
.notif-dropdown {
    position: absolute; top: calc(100% + 10px); left: 0; width: 350px; max-width: calc(100vw - 24px);
    background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 18px;
    box-shadow: var(--shadow-elevated); z-index: 9999; display: flex; flex-direction: column; overflow: hidden;
}
.notif-dropdown-header {
    padding: 13px 16px; border-bottom: 1px solid var(--border-glass);
    display: flex; align-items: center; justify-content: space-between;
}
.notif-close-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; }
.notif-dropdown-list { max-height: 360px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.notif-card {
    background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: 12px;
    padding: 11px 13px; cursor: pointer; transition: 0.2s;
}
.notif-card.unread { border-color: var(--gold-primary); background: rgba(212, 175, 55, 0.08); }
.notif-card-title { font-weight: 800; font-size: 13px; display: flex; justify-content: space-between; margin-bottom: 4px; }
.notif-card-body { font-size: 12px; color: var(--text-muted); margin: 0; }
.notif-card-date { font-size: 10.5px; color: var(--text-dim); margin-top: 5px; display: block; }

/* Session History Items & Mobile Bottom Navigation */
.drawer-session-item {
    display: flex; align-items: center; justify-content: space-between; padding: 11px 14px;
    border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border-glass);
    cursor: pointer; color: var(--text-pure); font-size: 13.5px; font-weight: 700;
    transition: all 0.2s ease;
}
.drawer-session-item:hover, .drawer-session-item.active {
    border-color: var(--gold-primary); color: var(--gold-primary); background: rgba(212, 175, 55, 0.1);
}

nav#bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; width: 100%;
    height: calc(64px + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
    background: var(--bg-surface); border-top: 1px solid var(--border-glass);
    z-index: 100; justify-content: space-between; align-items: stretch;
}
.bottom-nav-item {
    flex: 1 1 0%;
    min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: transparent; border: none; color: var(--text-muted); font-family: var(--font-ar);
    font-size: 11px; font-weight: 700; cursor: pointer; padding: 6px 4px;
    text-align: center;
    white-space: nowrap;
}
.bottom-nav-item i { font-size: 19px; }
.bottom-nav-item.active { color: var(--gold-primary); font-weight: 800; }

#ios-install-banner {
    display: none; background: var(--bg-surface); border: 1px solid var(--gold-primary);
    border-radius: 14px; padding: 12px 16px; margin: 12px 18px; align-items: center; gap: 12px;
}
#ios-install-banner.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.spin-icon { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

@media (max-width: 900px) {
    aside#sidebar { display: none !important; }
    nav#bottom-nav { display: flex !important; }
    main#main-content {
        height: calc(100dvh - 64px - var(--safe-bottom)) !important;
    }
    .chat-input-bar { margin: 0 10px 8px; padding: 8px 12px; }
    .wallet-actions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    header#topbar {
        padding: 0 12px;
        gap: 8px;
    }
    .topbar-right, .topbar-left {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    header#topbar {
        padding: 0 10px;
        gap: 6px;
    }
    .topbar-right, .topbar-left {
        gap: 6px;
    }
    .topbar-newchat-btn {
        padding: 6px 10px;
        font-size: 11.5px;
    }
    .topbar-icon-btn {
        width: 34px;
        height: 34px;
    }
}


