/* ─── QRStage Apple iOS / macOS Design System ──────────────────────── */
:root {
    --font-ar: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Apple Palette */
    --apple-blue: #007AFF;
    --apple-blue-hover: #0062cc;
    --apple-blue-light: rgba(0, 122, 255, 0.12);
    --apple-cyan: #32ADE6;
    --apple-teal: #30B0C7;
    --apple-green: #34C759;
    --apple-orange: #FF9500;
    --apple-red: #FF3B30;
    --apple-purple: #AF52DE;
    --apple-pink: #FF2D55;
    --apple-sun: #FFD60A; /* Solar Amber */
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-page: #F2F2F7;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #FFFFFF;
    --bg-secondary: #E5E5EA;
    --bg-tertiary: #D1D1D6;
    --bg-glass: rgba(255, 255, 255, 0.82);
    --bg-card: rgba(255, 255, 255, 0.94);
    
    --text-primary: #1C1C1E;
    --text-secondary: #636366;
    --text-tertiary: #8E8E93;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.14);
    --border-accent: rgba(0, 122, 255, 0.3);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --shadow-preview: 0 20px 48px rgba(0, 122, 255, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
    
    --sun-display: none;
    --moon-display: inline-block;
}

/* Dark Theme (Default Apple OLED Black) */
[data-theme="dark"] {
    --bg-page: #000000;
    --bg-surface: #121214;
    --bg-surface-elevated: #1C1C1E;
    --bg-secondary: #2C2C2E;
    --bg-tertiary: #3A3A3C;
    --bg-glass: rgba(18, 18, 20, 0.82);
    --bg-card: rgba(28, 28, 30, 0.78);
    
    --text-primary: #F2F2F7;
    --text-secondary: #AEAEB2;
    --text-tertiary: #8E8E93;
    
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.16);
    --border-accent: rgba(0, 122, 255, 0.45);
    
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.8);
    --shadow-preview: 0 24px 60px rgba(0, 122, 255, 0.22), 0 4px 20px rgba(0, 0, 0, 0.7);
    
    --sun-display: inline-block;
    --moon-display: none;
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

html, body {
    direction: rtl !important;
}

body {
    font-family: var(--font-ar);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body[dir="ltr"], html[lang="en"] body, [lang="en"] {
    font-family: var(--font-en);
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ─── Navigation Header ─────────────────────────────────────────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 16px;
    width: 100%;
    box-sizing: border-box;
    transition: var(--transition);
}

.nav-container {
    max-width: 1580px;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    direction: rtl !important;
    box-sizing: border-box;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.brand-link:hover {
    opacity: 0.94;
    transform: translateY(-1px);
}

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.16);
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

[data-theme="dark"] .brand-badge {
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 18px rgba(0, 122, 255, 0.28), 0 0 10px rgba(0, 199, 190, 0.12);
}

.brand-link:hover .brand-badge {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.32);
}

.brand-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
}

[dir="rtl"] .brand-text {
    align-items: flex-start;
    text-align: right;
}

[dir="ltr"] .brand-text {
    align-items: flex-start;
    text-align: left;
}

.brand-title {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--text-primary);
    direction: ltr !important;
    unicode-bidi: isolate !important;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
}

.brand-subtitle {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-top: 3px;
    letter-spacing: -0.1px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-item i {
    font-size: 0.95rem;
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-surface-elevated);
    color: var(--apple-blue);
    box-shadow: var(--shadow-sm);
}

/* Native Mobile Bottom Bar (Hidden on Desktop) */
.mobile-bottom-bar {
    display: none;
}

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

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    transform: translateY(-1px);
}

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

.solar-toggle {
    width: 38px;
    padding: 0;
}

.solar-toggle .sun-icon {
    display: var(--sun-display);
    color: var(--apple-sun);
    font-size: 1.15rem;
    filter: drop-shadow(0 0 6px rgba(255, 214, 10, 0.6));
}

.solar-toggle .moon-icon {
    display: var(--moon-display);
    color: var(--apple-blue);
    font-size: 1.05rem;
}

/* ─── Main Studio Layout ────────────────────────────────────────────── */
.main-content {
    flex: 1;
    max-width: 1580px;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 20px 16px 48px;
    box-sizing: border-box;
    min-width: 0;
}

.studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 20px;
    align-items: stretch !important;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    direction: rtl !important;
}

.studio-controls {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.studio-preview {
    min-width: 0;
    width: 100%;
    height: 100% !important;
    min-height: 100%;
    box-sizing: border-box;
    position: relative;
}

/* ─── Studio Desktop App Layout: Fixed Preview, Independent Scrollable Form ─── */
/* ─── Studio Desktop Layout (Large Screens >= 1041px) ───────────────── */
@media (min-width: 1041px) {
    .studio-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 20px;
        align-items: stretch !important;
        direction: rtl !important;
    }

    .studio-preview {
        height: 100% !important;
        position: relative;
    }

    .preview-sticky-wrap {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 76px !important;
        z-index: 50;
    }
}

/* ─── Medium Screens & Laptops (1041px - 1240px) ─────────────────────── */
@media (min-width: 1041px) and (max-width: 1240px) {
    .studio-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 16px;
    }
    .preview-canvas-wrapper {
        width: 250px;
        min-height: 250px;
    }
}

/* ─── Tablets & Small Laptops (769px - 1040px) ───────────────────────── */
@media (max-width: 1040px) {
    .studio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .studio-preview {
        order: -1;
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
    }

    .preview-sticky-wrap {
        position: static !important;
        max-height: none !important;
    }

    .preview-box {
        padding: 20px !important;
    }

    .preview-canvas-wrapper {
        width: 230px !important;
        height: 230px !important;
        margin-bottom: 14px !important;
    }
}

/* ─── Mobile Devices & Small Tablets (<= 768px) ──────────────────────── */
@media (max-width: 768px) {
    /* Safe container spacing */
    .main-content {
        padding: 12px 14px calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .app-header {
        position: relative !important;
        top: auto !important;
        height: auto !important;
        min-height: 52px !important;
        padding: 8px 14px !important;
        z-index: 100 !important;
    }

    .nav-container {
        gap: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .brand-link {
        gap: 10px;
    }

    .brand-badge {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .brand-title {
        font-size: 1.15rem;
    }

    .brand-subtitle {
        font-size: 0.68rem;
    }

    /* Hide top nav links completely on mobile */
    .desktop-nav {
        display: none !important;
    }

    /* Fixed App-like Mobile Bottom Tab Bar */
    .mobile-bottom-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999999 !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        background: rgba(18, 18, 20, 0.94) !important;
        backdrop-filter: blur(28px) saturate(190%) !important;
        -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
        border-top: 1px solid var(--border-medium) !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.4) !important;
    }

    [data-theme="light"] .mobile-bottom-bar {
        background: rgba(255, 255, 255, 0.96) !important;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    .mobile-tab-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        padding: 6px 8px !important;
        font-size: 0.72rem !important;
        font-weight: 600 !important;
        color: var(--text-secondary) !important;
        border-radius: 10px !important;
        flex: 1 !important;
        text-align: center !important;
        text-decoration: none !important;
        background: transparent !important;
        transition: transform 0.15s ease, color 0.15s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .mobile-tab-item i {
        font-size: 1.25rem !important;
        line-height: 1 !important;
    }

    .mobile-tab-item:active {
        transform: scale(0.92) !important;
    }

    .mobile-tab-item.active {
        color: var(--apple-blue) !important;
        font-weight: 700 !important;
    }

    .mobile-tab-item.active i {
        color: var(--apple-blue) !important;
        filter: drop-shadow(0 2px 8px rgba(0, 122, 255, 0.4)) !important;
    }

    /* Studio Grid Mobile Flow */
    .studio-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .studio-preview {
        order: -1;
        position: relative !important;
        top: auto !important;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 !important;
        border-bottom: none !important;
        background: transparent !important;
    }

    .preview-box {
        padding: 16px !important;
        border-radius: var(--radius-lg);
        width: 100%;
    }

    .preview-canvas-wrapper {
        width: min(210px, 62vw) !important;
        height: min(210px, 62vw) !important;
        margin-bottom: 12px !important;
    }

    /* Category Grid on Mobile */
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        gap: 8px;
        margin-bottom: 16px;
    }

    .category-card {
        padding: 8px 4px;
        border-radius: var(--radius-sm);
    }

    .cat-icon-wrap {
        width: 32px;
        height: 32px;
        font-size: 1.05rem;
        border-radius: 8px;
    }

    .cat-label {
        font-size: 0.72rem;
    }

    /* Themes Horizontal Strip */
    .theme-card-btn {
        flex: 0 0 84px;
        padding: 8px 6px;
    }

    .theme-mini-preview {
        width: 52px;
        height: 52px;
    }

    .theme-card-name {
        font-size: 0.72rem;
    }

    /* Form Fields & Controls */
    .card-glass {
        padding: 16px;
        border-radius: var(--radius-lg);
        margin-bottom: 16px;
    }

    .card-title {
        font-size: 1.05rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .color-picker-grid {
        gap: 10px;
        margin-bottom: 16px;
    }

    .color-rect-btn {
        height: 48px;
        font-size: 0.82rem;
    }

    .segmented-control {
        height: 34px;
        margin-bottom: 18px;
    }

    .seg-btn {
        height: 28px;
        font-size: 0.75rem;
    }

    /* Buttons */
    .btn-primary, .btn-secondary {
        height: 44px;
        font-size: 0.88rem;
    }

    .export-row-primary {
        gap: 8px;
    }

    /* Floating Toast Notification */
    .toast-pill {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 32px);
        max-width: 380px;
        justify-content: center;
        font-size: 0.84rem;
        padding: 10px 16px;
    }

    /* Footer Mobile Bottom Spacing for Fixed Tab Bar */
    .app-footer {
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }
}

/* ─── Extra Small Mobile Screens (<= 480px) ─────────────────────────── */
@media (max-width: 480px) {
    .brand-subtitle {
        display: none; /* Hide subtitle on ultra-narrow screens to keep header sleek */
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .category-card {
        padding: 8px 2px;
    }

    .color-picker-grid {
        grid-template-columns: 1fr;
    }

    .media-actions-grid {
        grid-template-columns: 1fr;
    }

    .export-row-primary {
        grid-template-columns: 1fr;
    }

    .preview-canvas-wrapper {
        width: 180px !important;
        height: 180px !important;
    }
}

/* ─── Glass Cards & Containers ──────────────────────────────────────── */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card-glass:hover {
    border-color: var(--border-medium);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--apple-blue);
    font-size: 1.2rem;
}

/* ─── Category Grid Selector ────────────────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 6px;
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.category-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-card.active {
    background: var(--apple-blue-light);
    border-color: var(--apple-blue);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2);
}

.cat-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.category-card.active .cat-icon-wrap {
    transform: scale(1.08);
}

.cat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

/* Category Specific Colors */
.cat-text .cat-icon-wrap { background: rgba(142, 142, 147, 0.15); color: #8E8E93; }
.cat-url .cat-icon-wrap { background: rgba(0, 122, 255, 0.15); color: #007AFF; }
.cat-phone .cat-icon-wrap { background: rgba(52, 199, 89, 0.15); color: #34C759; }
.cat-sms .cat-icon-wrap { background: rgba(50, 173, 230, 0.15); color: #32ADE6; }
.cat-email .cat-icon-wrap { background: rgba(0, 122, 255, 0.15); color: #007AFF; }
.cat-wifi .cat-icon-wrap { background: rgba(48, 176, 199, 0.15); color: #30B0C7; }
.cat-contact .cat-icon-wrap { background: rgba(0, 122, 255, 0.15); color: #007AFF; }
.cat-location .cat-icon-wrap { background: rgba(255, 59, 48, 0.15); color: #FF3B30; }
.cat-event .cat-icon-wrap { background: rgba(255, 149, 0, 0.15); color: #FF9500; }
.cat-social .cat-icon-wrap { background: rgba(175, 82, 222, 0.15); color: #AF52DE; }

/* ─── Form Inputs ───────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.92rem;
    transition: var(--transition);
    outline: none;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ─── Color Rectangles (User Request: مستطيلين يتلونون افتراضياً) ─────── */
.color-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.color-rect-btn {
    position: relative;
    height: 52px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.color-rect-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.color-rect-btn:active {
    transform: scale(0.98);
}

.color-hidden-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

/* ─── Error Correction Slider (User Request: شريط ارفع وانحف) ────────── */
.segmented-control {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: 22px;
    height: 36px;
    align-items: center;
}

.seg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.seg-btn:hover {
    color: var(--text-primary);
}

.seg-btn.active {
    background: var(--bg-surface-elevated);
    color: var(--apple-blue);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ─── Style & Theme Strip (User Request: شريط افقي مع معاينة مصغرة) ──── */
.theme-strip-container {
    margin-top: 10px;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
    box-sizing: border-box;
}

.theme-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 2px 14px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.theme-strip::-webkit-scrollbar {
    height: 6px;
}

.theme-strip::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.theme-strip::-webkit-scrollbar-thumb {
    background: var(--apple-blue);
    border-radius: var(--radius-full);
}

.theme-card-btn {
    flex: 0 0 94px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.theme-card-btn:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.theme-card-btn.active {
    border-color: var(--apple-blue);
    background: var(--apple-blue-light);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2);
}

.theme-mini-preview {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.theme-mini-preview canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.theme-card-name {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.theme-card-btn.active .theme-card-name {
    color: var(--apple-blue);
    font-weight: 700;
}

/* ─── Frames Strip & Cards ──────────────────────────────────────────── */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.badge-pill-soft {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--apple-blue);
    background: var(--apple-blue-light);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.frames-strip-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin-bottom: 14px;
    min-width: 0;
    box-sizing: border-box;
}

.frames-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 14px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--apple-blue) transparent;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.frames-strip::-webkit-scrollbar {
    height: 6px;
}

.frames-strip::-webkit-scrollbar-thumb {
    background: var(--apple-blue);
    border-radius: var(--radius-full);
}

.frame-card-btn {
    flex: 0 0 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    scroll-snap-align: start;
}

.frame-card-btn:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.frame-card-btn.active {
    border-color: var(--apple-blue);
    background: var(--apple-blue-light);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.22);
}

.frame-mini-preview {
    width: 66px;
    height: 66px;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 3px;
}

.frame-mini-preview canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block;
}

.frame-card-name {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.frame-card-btn.active .frame-card-name {
    color: var(--apple-blue);
    font-weight: 700;
}

/* ─── Custom Frame Builder Card ─────────────────────────────────────── */
.custom-frame-card {
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-top: 14px;
    animation: fadeIn 0.25s ease;
    box-shadow: var(--shadow-sm);
}

.custom-frame-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.custom-frame-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-sublabel {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.frame-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-color-picker {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-medium);
    padding: 2px;
    cursor: pointer;
    background: transparent;
    flex-shrink: 0;
}

.frame-palette-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.palette-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.palette-dot:hover {
    transform: scale(1.18);
}

.palette-dot.active {
    border-color: #FFFFFF;
    box-shadow: 0 0 0 2px var(--apple-blue);
    transform: scale(1.15);
}

.segmented-control.slim {
    height: 36px;
    padding: 3px;
    gap: 3px;
}

.segmented-control.slim .seg-btn {
    font-size: 0.78rem;
    padding: 4px 10px;
}

.frame-icon-select-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.frame-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.frame-icon-btn:hover {
    color: var(--apple-blue);
    border-color: var(--apple-blue);
    transform: translateY(-1px);
}

.frame-icon-btn.active {
    background: var(--apple-blue);
    color: #FFFFFF;
    border-color: var(--apple-blue);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35);
}

/* ─── Media & Logo Buttons ──────────────────────────────────────────── */
.media-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.media-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-surface-elevated);
    border: 1.5px dashed var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.media-upload-btn:hover {
    border-color: var(--apple-blue);
    color: var(--apple-blue);
    background: var(--apple-blue-light);
}

.media-upload-btn.active {
    border-style: solid;
    border-color: var(--apple-blue);
    color: var(--apple-blue);
    background: var(--apple-blue-light);
}

.media-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.media-badge-row .btn-remove {
    background: none;
    border: none;
    color: var(--apple-red);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.media-badge-row .btn-remove:hover {
    transform: scale(1.15);
}

/* ─── Fixed / Sticky Live Preview Panel ─────────────────────────────── */
.preview-sticky-wrap {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 76px !important;
    z-index: 50;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
}

.preview-sticky-wrap::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.preview-box {
    background: var(--bg-card);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-preview);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.preview-canvas-wrapper {
    width: 290px;
    min-height: 290px;
    max-height: 390px;
    height: auto;
    border-radius: var(--radius-lg);
    background: #FFFFFF;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px;
}

.preview-canvas-wrapper canvas {
    max-width: 100% !important;
    max-height: 365px !important;
    width: auto !important;
    height: auto !important;
    display: block;
    object-fit: contain;
    border-radius: 10px;
}

.preview-footer-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: -10px;
    margin-bottom: 16px;
    text-align: center;
}

.export-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.export-row-primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-md);
    background: var(--apple-blue);
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--apple-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.45);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--border-medium);
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--apple-blue);
    color: var(--apple-blue);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* ─── Apple Toast Notification ──────────────────────────────────────── */
.toast-pill {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(20px);
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .toast-pill {
    background: rgba(255, 255, 255, 0.95);
    color: #1C1C1E;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

.toast-pill.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-pill .toast-icon {
    color: var(--apple-green);
    font-size: 1.1rem;
}

/* ─── Footer (Distributed From Right to Left, Centered Copyright) ───── */
.app-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 24px 16px;
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

.footer-container {
    max-width: 1580px;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    direction: rtl !important;
    box-sizing: border-box;
}

/* 1. Right side (in RTL): Brand & Description */
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    justify-self: start;
    text-align: start;
}

.footer-brand-head {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.footer-brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.footer-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.footer-brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    line-height: 1;
    font-family: var(--font-en);
}

.footer-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.45;
    max-width: 360px;
    margin: 0;
}

/* 2. Dead Center: Copyright */
.footer-copy {
    justify-self: center;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
    padding: 0 12px;
}

/* 3. Left side (in RTL): Social Media Buttons */
.footer-social-links {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 10px;
    flex-wrap: wrap;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.18rem;
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.social-btn:hover {
    transform: translateY(-2px) scale(1.06);
}

.social-btn.facebook:hover { background: #1877F2; color: #FFFFFF; border-color: #1877F2; box-shadow: 0 6px 18px rgba(24, 119, 242, 0.3); }
.social-btn.telegram:hover { background: #24A1DE; color: #FFFFFF; border-color: #24A1DE; box-shadow: 0 6px 18px rgba(36, 161, 222, 0.3); }
.social-btn.twitter:hover { background: #000000; color: #FFFFFF; border-color: #333333; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.social-btn.instagram:hover { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); color: #FFFFFF; border-color: transparent; box-shadow: 0 6px 18px rgba(220, 39, 67, 0.3); }
.social-btn.whatsapp:hover { background: #25D366; color: #FFFFFF; border-color: #25D366; box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3); }
.social-btn.youtube:hover { background: #FF0000; color: #FFFFFF; border-color: #FF0000; box-shadow: 0 6px 18px rgba(255, 0, 0, 0.3); }
.social-btn.linkedin:hover { background: #0A66C2; color: #FFFFFF; border-color: #0A66C2; box-shadow: 0 6px 18px rgba(10, 102, 194, 0.3); }
.social-btn.github:hover { background: #24292F; color: #FFFFFF; border-color: #24292F; box-shadow: 0 6px 18px rgba(36, 41, 47, 0.3); }

.badge-pill {
    padding: 2px 8px;
    background: var(--apple-blue-light);
    color: var(--apple-blue);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.7rem;
}

@media (max-width: 900px) {
    .app-footer {
        padding: 24px 16px calc(88px + env(safe-area-inset-bottom, 0px));
    }
    .footer-container {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 16px;
    }
    .footer-brand {
        flex-direction: column;
        align-items: center;
        justify-self: center;
        text-align: center;
        gap: 10px;
    }
    .footer-brand-head {
        justify-content: center;
    }
    .footer-desc {
        text-align: center;
        max-width: 100%;
    }
    .footer-copy {
        justify-self: center;
        order: 2;
    }
    .footer-social-links {
        justify-self: center;
        order: 1;
    }
}

/* ─── Social Media Strip & Circular Icon Buttons ─── */
.social-strip-section {
    width: 100%;
    margin-bottom: 12px;
}

.social-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.social-hint {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.social-strip-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.social-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 4px 14px;
    direction: rtl !important;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--apple-blue) transparent;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}

.social-strip::-webkit-scrollbar {
    height: 5px;
}

.social-strip::-webkit-scrollbar-thumb {
    background: var(--apple-blue);
    border-radius: var(--radius-full);
}

.social-icon-btn {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    border: 2px solid var(--border-subtle);
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    scroll-snap-align: start;
    box-shadow: var(--shadow-sm);
    outline: none;
}

.social-icon-btn:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--platform-color, var(--apple-blue));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.social-icon-btn.active {
    border-color: var(--apple-blue);
    box-shadow: 0 0 16px rgba(0, 122, 255, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.12);
}

.social-btn-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 20px;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

#socialNoLogoBtn {
    background: var(--bg-surface-elevated);
    color: var(--text-tertiary);
    font-size: 22px;
    border: 2px dashed var(--border-medium);
}

#socialNoLogoBtn:hover {
    color: var(--apple-red);
    border-color: var(--apple-red);
    background: rgba(255, 59, 48, 0.1);
}

#socialNoLogoBtn.active {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

/* ─── Floating App Download Bar (Identical Identity & Shape to Reference) ─── */
.qrstage-floating-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 998;
    max-width: 650px;
    width: calc(100% - 32px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    animation: bannerSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bannerSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.qrstage-floating-banner.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(80px);
    pointer-events: none;
}

.qrstage-banner-card {
    background: linear-gradient(135deg, #2E0854 0%, #1A0436 100%);
    border: 1px solid rgba(168, 85, 247, 0.45);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65), 0 0 24px rgba(147, 51, 234, 0.28);
    border-radius: 100px;
    padding: 7px 14px 7px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #FFFFFF;
}

/* Dismiss (X) Button */
.banner-dismiss-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    line-height: 1;
    flex-shrink: 0;
}

.banner-dismiss-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

/* Brand Section */
.banner-brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.banner-qr-badge {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(168, 85, 247, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
    flex-shrink: 0;
}

.banner-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.banner-title-text {
    font-family: var(--font-ar);
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

/* Store Action Buttons */
.banner-store-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.banner-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #6D28D9;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-en);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.banner-store-btn:hover {
    background: #7C3AED;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(109, 40, 217, 0.45);
    border-color: rgba(255, 255, 255, 0.38);
    color: #FFFFFF;
}

.banner-store-btn .play-svg-icon {
    flex-shrink: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .qrstage-floating-banner {
        bottom: 78px; /* Sits cleanly above the native mobile bottom bar */
        width: calc(100% - 20px);
    }
    
    .qrstage-banner-card {
        border-radius: 20px;
        padding: 8px 12px;
        gap: 8px;
    }

    .banner-title-text {
        font-size: 0.84rem;
    }

    .banner-store-btn {
        padding: 6px 11px;
        font-size: 0.74rem;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .banner-title-text {
        display: none; /* Keep clean on ultra-small screens */
    }
    .qrstage-banner-card {
        padding: 6px 10px;
    }
}

/* ─── App Download Modal Backdrop & Card ─── */
.app-download-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.app-download-modal-box {
    background: var(--bg-surface-elevated, #1C1C1E);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 28px;
    max-width: 440px;
    width: 100%;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    color: var(--text-primary, #FFFFFF);
    animation: modalCardPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalCardPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close-icon-btn {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary, #A1A1AA);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.modal-app-icon-wrap {
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.35);
}

.modal-app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-app-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 6px 0;
}

.modal-app-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary, #A1A1AA);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.modal-qr-preview {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 16px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    margin-bottom: 22px;
}

.modal-qr-frame {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-qr-hint {
    color: #1C1C1E;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-store-badges-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.store-badge-img {
    height: 44px;
    width: auto;
    border-radius: 8px;
    transition: var(--transition);
}

.store-badge-img:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.modal-direct-apk-wrap {
    margin-top: 6px;
}

.btn-direct-apk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 122, 255, 0.14);
    color: #007AFF;
    border: 1px solid rgba(0, 122, 255, 0.3);
    border-radius: 100px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    width: 100%;
}

.btn-direct-apk:hover {
    background: #007AFF;
    color: #FFFFFF;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}


