:root {
    --bg-dark: #020617;
    --sidebar-bg: rgba(15, 23, 42, 0.85);
    --card-bg: rgba(30, 41, 59, 0.4);
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border-soft: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(3, 7, 18, 0.5);
    --radius: 12px;
    --glass-blur: 15px;
}

/* Strategic Protection: Disable selection and long-press callouts */
.app-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Orientation Warning - Only show on mobile portrait */
.orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.97);
    backdrop-filter: blur(10px);
    z-index: 99999999;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

.orientation-warning .warning-content {
    max-width: 320px;
}

.orientation-warning .warning-content h2 {
    font-size: 1.3rem;
    margin: 20px 0 10px;
    color: var(--accent);
}

.orientation-warning .warning-content p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.orientation-warning .rotate-icon {
    width: 60px;
    height: 60px;
    color: var(--accent);
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Only show on small screens in portrait mode */
@media (max-width: 768px) and (orientation: portrait) {
    .orientation-warning {
        display: flex;
    }
}

/* Header UI Refinements */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
    margin-left: 15px;
}

.header-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-radius: 10px;
    height: 36px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.header-actions .btn.info {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: #fff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.header-actions .btn.info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(14, 165, 233, 0.6);
    filter: brightness(1.15);
}

.header-actions .btn.secondary {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.header-actions .btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
    filter: brightness(1.15);
}

.header-actions .btn.outline {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.header-actions .btn.outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6);
    filter: brightness(1.15);
}

/* Top Nạp Card Style - Match Reference Image */
.top-depositor-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card-header.blue {
    background: #2563eb;
    color: white;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.9rem;
}

.card-header.blue i {
    width: 20px;
    height: 20px;
}

.card-body {
    padding: 10px;
}

.depositor-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.box-left {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.85rem;
}

.box-right .amount {
    color: #f97316;
    font-weight: 800;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
}

.btn-deposit-now {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    transition: 0.3s;
    text-transform: uppercase;
}

.btn-deposit-now:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.sidebar-support-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 1025px) {
    .sidebar-support-links {
        display: none !important;
    }
}

.sidebar-support-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-soft);
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.sidebar-support-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.sidebar-support-btn i {
    width: 16px;
    height: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #020617 100%);
}

/* Sidebar */
.sidebar {
    width: 360px;
    background: var(--sidebar-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--border-soft);
    display: flex !important;
    flex-direction: column !important;
    z-index: 9999999 !important;
    height: 100vh !important;
    overflow: visible !important;
    position: relative !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Header */
.sidebar-header {
    flex-shrink: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 20px 16px;
    min-height: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

.mobile-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Collapsible Top Nạp */
.top-depositor-card.collapsible .card-header {
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.top-depositor-card.collapsible .card-header:hover {
    background: #1d4ed8;
}

.top-depositor-card.collapsible .header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-depositor-card.collapsible .chevron-icon {
    transition: transform 0.3s;
    width: 18px;
    height: 18px;
}

.top-depositor-card.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.top-depositor-card.collapsed .card-body {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 320px;
        height: 100vh !important;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999999 !important;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        display: flex !important;
        flex-direction: column !important;
        background: var(--sidebar-bg) !important;
        backdrop-filter: blur(20px);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .mobile-close-btn {
        display: flex;
    }

    .workspace-header {
        padding-left: 70px !important;
    }

    .mobile-toggle,
    .mobile-fab-container {
        display: flex;
    }

    .preview-container {
        padding: 40px 10px;
        touch-action: auto !important;
    }
}

@media (max-width: 640px) {

    .header-hint,
    .zoom-controls {
        display: none;
    }

    .logo span {
        font-size: 0.75rem;
    }
}

/* Replaced by .sidebar-content above */

.control-group {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-soft);
    transition: 0.3s;
}

.control-group:hover {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.control-group h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.input-row-header {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin: 10px 0 6px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 2px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.input-grid.quad {
    grid-template-columns: repeat(4, 1fr);
}

.input-row {
    margin-bottom: 10px;
}

.input-row label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 6px;
    color: var(--text-dim);
    font-weight: 500;
}

.input-row input[type="number"],
.input-row input[type="text"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-soft);
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.color-row {
    display: flex;
    gap: 8px;
}

.color-row input[type="text"] {
    flex: 1;
    pointer-events: none;
    opacity: 0.8;
}

.color-row input[type="color"] {
    width: 40px;
    height: 38px;
    border: none;
    background: var(--input-bg);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    white-space: nowrap;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 15px -5px rgba(245, 158, 11, 0.4);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(245, 158, 11, 0.5);
    filter: brightness(1.1);
}

.btn.secondary {
    background: #334155;
    color: white;
}

.btn.secondary:hover {
    background: #475569;
}

.btn.outline {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: white;
}

.btn.outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.full-width {
    width: 100%;
}

.stats-counter {
    background: #0f172a;
    padding: 4px 0;
    text-align: center;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 8px;
    font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-soft);
    flex-shrink: 0;
}

/* Main Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #020617;
}

.workspace-header {
    padding: 12px 20px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-soft);
    position: relative !important;
    z-index: 8888888 !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.logo i {
    color: var(--accent);
}

.header-hint {
    font-size: 0.85rem;
    color: var(--accent);
    opacity: 0.8;
    background: rgba(202, 138, 4, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(202, 138, 4, 0.2);
    font-style: italic;
    font-weight: 500;
}

/* Mobile Responsive & UX Improvements */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 8999999 !important;
    /* Higher than header's 8.8M */
    background: var(--accent);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.mobile-fab-container {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 8999999 !important;
    gap: 12px;
    flex-direction: column-reverse;
}

.fab {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid var(--border-soft);
}

.fab i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.fab.primary {
    background: var(--accent);
}

.fab.secondary {
    width: 45px;
    height: 45px;
    opacity: 0.8;
}

/* Consolidated media queries moved to line 317 */

@media (max-width: 640px) {
    .header-hint {
        display: none;
    }

    .zoom-controls {
        display: none;
    }

    .logo span {
        font-size: 0.75rem;
    }

    .input-grid.quad {
        grid-template-columns: 1fr 1fr;
    }

    .preview-container {
        padding: 10px;
    }
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.zoom-controls input[type="range"] {
    width: 120px;
    accent-color: var(--accent);
}

.preview-container {
    flex: 1;
    overflow: auto;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
}

canvas {
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000000 !important;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--sidebar-bg);
    width: 95vw;
    height: 90vh;
    max-width: 1200px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title i {
    color: var(--accent);
}

.modal-toolbar {
    padding: 16px 24px;
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-box input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-soft);
    padding: 10px 16px 10px 44px;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    gap: 12px;
}

.gallery-grid {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    border: 1px solid transparent;
}

.gallery-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.07);
}

.gallery-item.selected {
    border-color: var(--accent);
    background: rgba(202, 138, 4, 0.1);
    position: relative;
    box-shadow: 0 0 15px rgba(202, 138, 4, 0.2);
}

.gallery-item.selected::after {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--sidebar-bg);
}

.gallery-item img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.gallery-item span {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Toggle Slider */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-label {
    font-size: 0.8rem;
    font-weight: 500;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    user-select: none;
    margin-left: auto;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: #1e293b;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: 0.2s;
}

.user-profile-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
}

.user-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info-mini {
    display: flex;
    flex-direction: column;
}

.user-info-mini .username {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.user-info-mini .balance {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 190px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    padding: 8px;
    z-index: 10000000 !important;
}

.dropdown-menu.show {
    display: flex !important;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #f1f5f9;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: 0.2s;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

.admin-panel-link {
    color: #38bdf8 !important;
}

.logout-link {
    color: #f87171 !important;
}

/* =========================================================
   MOBILE-ONLY STYLES — Everything below is @media guarded.
   PC stays 100% untouched.
   ========================================================= */

/* --- Bottom Navigation Bar --- */
.mobile-bottom-nav {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

/* --- Skin delete overlay on tap --- */
.skin-delete-overlay {
    display: none;
}

/* --- Mobile Account Panel --- */
.mobile-account-panel {
    display: none;
}

@media (max-width: 1024px) {

    /* ---- Bottom Navigation ---- */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: rgba(15, 23, 42, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9999998;
        align-items: stretch;
        justify-content: space-around;
        padding: 0 4px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-bottom-nav button {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: #94a3b8;
        font-size: 0.6rem;
        font-weight: 600;
        cursor: pointer;
        padding: 6px 2px;
        min-width: 44px;
        min-height: 44px;
        transition: color 0.2s, transform 0.15s;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        letter-spacing: 0.02em;
    }

    .mobile-bottom-nav button i {
        width: 22px;
        height: 22px;
    }

    .mobile-bottom-nav button:active {
        transform: scale(0.9);
        color: var(--accent);
    }

    .mobile-bottom-nav button.nav-active {
        color: var(--accent);
    }

    .mobile-bottom-nav button.nav-primary {
        color: #000;
        background: var(--accent);
        border-radius: 14px;
        margin: 6px 2px;
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    }

    .mobile-bottom-nav button.nav-primary i {
        color: #000;
    }

    .mobile-bottom-nav button.nav-primary span {
        color: #000;
        font-weight: 800;
    }

    /* ---- Hide old FAB, old toggle ---- */
    .mobile-fab-container {
        display: none !important;
    }

    .mobile-toggle {
        display: none !important;
    }

    /* ---- Sidebar as Bottom Sheet ---- */
    .sidebar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        height: 85vh !important;
        max-height: 85vh !important;
        transform: translateY(100%) !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-right: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6) !important;
        z-index: 10000001 !important;
    }

    .sidebar.active {
        transform: translateY(0) !important;
    }

    /* Drag handle at top of bottom sheet */
    .sidebar-header {
        position: relative;
        padding-top: 28px !important;
    }

    .sidebar-header::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .mobile-close-btn {
        display: flex !important;
        width: 38px;
        height: 38px;
    }

    /* ---- Sidebar Backdrop Overlay ---- */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 10000000;
        transition: opacity 0.3s;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    /* ---- Accordion Sections ---- */
    .control-group h2 {
        cursor: pointer;
        user-select: none;
        position: relative;
        padding-right: 28px;
    }

    .control-group h2::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid var(--accent);
        transition: transform 0.3s;
    }

    .control-group.collapsed h2::after {
        transform: translateY(-50%) rotate(-90deg);
    }

    .control-group-body {
        overflow: hidden;
        transition: max-height 0.35s ease, opacity 0.25s ease;
        max-height: 600px;
        opacity: 1;
    }

    .control-group.collapsed .control-group-body {
        max-height: 0 !important;
        opacity: 0;
        padding: 0;
        margin: 0;
    }

    /* ---- Touch-friendly Inputs ---- */
    .input-row input[type="number"],
    .input-row input[type="text"] {
        padding: 12px 14px !important;
        font-size: 16px !important;
        /* Prevents iOS auto-zoom */
        border-radius: 10px !important;
    }

    .input-row input[type="color"] {
        width: 56px !important;
        height: 48px !important;
        border-radius: 10px !important;
    }

    .input-row label {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
    }

    /* Single column on small screens */
    .input-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* ---- Buttons larger touch targets ---- */
    .btn {
        min-height: 44px;
        padding: 12px 16px !important;
        font-size: 0.85rem !important;
    }

    .control-group .btn.secondary.full-width {
        padding: 14px 16px !important;
        font-size: 0.9rem !important;
    }

    /* ---- Preview Container ---- */
    .preview-container {
        padding: 10px !important;
        padding-bottom: 72px !important;
        /* Space for bottom nav */
        touch-action: manipulation;
    }

    /* ---- Workspace Header Mobile ---- */
    .workspace-header {
        padding: 8px 12px !important;
        padding-left: 12px !important;
    }

    .header-actions {
        display: none !important;
        /* Move to bottom nav */
    }

    .user-dropdown {
        display: none !important;
        /* Move to bottom nav */
    }

    .top-bar {
        gap: 8px;
    }

    .top-bar .btn.secondary {
        padding: 8px 10px !important;
        font-size: 0.7rem !important;
        min-height: 36px;
    }

    .top-bar .btn.secondary i {
        width: 14px;
        height: 14px;
    }

    /* ---- Gallery Modal ---- */
    .modal {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    .gallery-item {
        padding: 6px;
        border-radius: 10px;
    }

    .gallery-item img {
        height: 120px !important;
        border-radius: 6px;
    }

    .gallery-item span {
        font-size: 0.65rem;
    }

    .modal-header {
        padding: 14px 16px !important;
    }

    .modal-toolbar {
        padding: 10px 12px !important;
        gap: 10px !important;
        flex-wrap: wrap;
    }

    .modal-toolbar .actions {
        width: 100%;
        justify-content: space-between;
    }

    .modal-toolbar .btn {
        flex: 1;
    }

    .search-box input {
        font-size: 16px !important;
        /* Prevent iOS zoom */
        padding: 12px 16px 12px 44px !important;
    }

    /* Gallery select all button */
    .gallery-select-all {
        display: flex !important;
    }

    /* ---- Sidebar Footer sticky ---- */
    .sidebar-footer {
        padding: 12px 16px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(15, 23, 42, 0.95);
    }

    /* ---- Top Depositor Card ---- */
    .top-depositor-card {
        margin-bottom: 12px !important;
    }

    .top-depositor-card .card-header {
        padding: 10px !important;
        font-size: 0.95rem !important;
    }

    /* ---- Orientation Warning — hide completely ---- */
    .orientation-warning {
        display: none !important;
    }

    /* ---- User Account Mobile Panel ---- */
    .mobile-account-panel {
        display: none;
        position: fixed;
        bottom: 62px;
        right: 8px;
        width: 200px;
        background: #1e293b;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 14px;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
        z-index: 9999999;
        padding: 8px;
        flex-direction: column;
    }

    .mobile-account-panel.show {
        display: flex;
    }

    .mobile-account-panel a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 14px;
        color: #f1f5f9;
        text-decoration: none;
        font-size: 0.85rem;
        font-weight: 500;
        border-radius: 10px;
        transition: 0.2s;
    }

    .mobile-account-panel a:active {
        background: rgba(255, 255, 255, 0.08);
    }

    .mobile-account-panel a i {
        width: 18px;
        height: 18px;
    }

    .mobile-account-panel .logout-link {
        color: #f87171 !important;
    }

    .mobile-account-panel .admin-link {
        color: #38bdf8 !important;
    }

    .mobile-account-panel hr {
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin: 4px 0;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .input-grid {
        grid-template-columns: 1fr !important;
    }

    .input-grid.quad {
        grid-template-columns: 1fr 1fr !important;
    }

    .mobile-bottom-nav button span {
        font-size: 0.55rem;
    }
}

/* Hide gallery select-all on desktop */
.gallery-select-all {
    display: none;
}