/* Dream-Girl Chat - Dashboard Styles
 * Mobile-first responsive dashboard framework
 * Matches chat.css and profile.css design tokens
 */

:root {
    /* Align dashboard/profile visuals with Hot-or-Not grid style */
    --dgc-dashboard-font: var(--dgc-hon-font, 'Space Grotesk', 'Sora', 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    --dgc-dashboard-bg: radial-gradient(140% 140% at 10% 10%, #1c1f2b 0%, #090b12 60%);
    --dgc-dashboard-card-bg: rgba(12, 14, 22, 0.62);
    --dgc-dashboard-card-bg-solid: rgba(14, 16, 26, 0.78);
    --dgc-dashboard-text: #f5f5ff;
    --dgc-dashboard-text-secondary: rgba(245, 245, 255, 0.72);
    --dgc-dashboard-border: rgba(255, 255, 255, 0.10);
    --dgc-dashboard-border-subtle: rgba(255, 255, 255, 0.07);
    --dgc-dashboard-primary: #ff5c8d;
    --dgc-dashboard-secondary: #66e3ff;
    --dgc-dashboard-radius: 18px;
    --dgc-dashboard-radius-lg: 28px;
    --dgc-dashboard-shadow: 0 25px 60px rgba(8, 10, 20, 0.6);
    --dgc-dashboard-blur: 18px;
    --dgc-dashboard-transition: 0.25s ease;
    --dgc-contacts-badge-bg: rgba(255, 20, 147, 0.92);
    --dgc-contacts-badge-text: #fff;
    --dgc-dashboard-footer-bg: var(--dgc-dashboard-header-bg, rgba(9, 11, 18, 0.25));
    --dgc-dashboard-footer-text: var(--dgc-dashboard-text-secondary);
    --dgc-dashboard-footer-border: var(--dgc-dashboard-border-subtle);
}

/* =========================================
   DASHBOARD WRAPPER & LAYOUT
   ======================================== */

.dgc-dashboard-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: var(--dgc-dashboard-font);
    color: var(--dgc-dashboard-text);
    border-radius: var(--dgc-dashboard-radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--dgc-dashboard-shadow);

    /* Prevent child padding/borders from causing overflow widths */
    box-sizing: border-box;

    /* Make embedded components inherit the dashboard theme */
    --dgc-hon-wrapper-bg: var(--dgc-dashboard-card-bg);
    --dgc-hon-wrapper-border: var(--dgc-dashboard-border);
    --dgc-hon-wrapper-color: var(--dgc-dashboard-text);
    --dgc-hon-wrapper-radius: var(--dgc-dashboard-radius-lg);
    --dgc-hon-accent: var(--dgc-dashboard-primary);
    --dgc-hon-accent-secondary: var(--dgc-dashboard-secondary);

    --dgc-profile-card: var(--dgc-dashboard-card-bg);
    --dgc-profile-card-2: var(--dgc-dashboard-card-bg-solid);
    --dgc-profile-border: var(--dgc-dashboard-border);

    /* Used for viewport-fitting calculations */
    --dgc-dashboard-header-height: 80px;
}

/* Keep normal dashboard content above background media. */
.dgc-dashboard-wrapper > :not(.dgc-dashboard-bg-media) {
    position: relative;
    z-index: 1;
}

/* Background media layer (optional): image/video behind the dashboard UI. */
.dgc-dashboard-bg-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.dgc-dashboard-wrapper:not(.is-fullscreen) .dgc-dashboard-bg-media.is-fullscreen-only {
    display: none;
}

.dgc-dashboard-bg-media--image {
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: translateZ(0);
}

.dgc-dashboard-bg-media--video .dgc-dashboard-bg-media-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Ensure all dashboard elements size predictably (prevents subtle overflow/cutoff). */
.dgc-dashboard-wrapper,
.dgc-dashboard-wrapper * {
    box-sizing: border-box;
}

/* Fullscreen mode (optional via UI toggle)
   Desktop: lock page scroll.
   Mobile: lock background scroll ONLY while fullscreen so page/footer can't appear under the bottom tabs. */
@media (min-width: 1024px) {
    html.dgc-dashboard-fullscreen,
    body.dgc-dashboard-fullscreen {
        overflow: hidden;
    }
}

@media (max-width: 1023px) {
    /* While the chat message input is focused, lock page scroll so the browser
       cannot pan the entire dashboard/background to reveal the input. */
    body.dgc-dashboard-chat-focus-lock {
        overflow: hidden !important;
        overscroll-behavior: none;
        height: 100% !important;
    }

    html.dgc-dashboard-chat-focus-lock {
        overflow: hidden !important;
        height: 100% !important;
    }

    .dgc-dashboard-wrapper {
        /* Mobile bottom tabs are visible by default. */
        --dgc-dashboard-tabs-height: 72px;
        /* Include device safe-area in chat/tab spacing calculations. */
        --dgc-dashboard-tabs-total-height: calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px));
    }

    /* While onboarding/guest is active, do not reserve bottom-tab space. */
    .dgc-dashboard-wrapper--guest .dgc-dashboard-main-scroll,
    .dgc-dashboard-wrapper[data-onboarding-complete="0"] .dgc-dashboard-main-scroll,
    .dgc-dashboard-wrapper .dgc-onboarding-overlay.is-open ~ .dgc-dashboard-grid .dgc-dashboard-main-scroll {
        padding-bottom: 0 !important;
    }

    /* If a chat is rendered in any dashboard tab OTHER than the Chat tab (e.g., Browse/Profile on mobile),
       reserve space for the fixed bottom tabs so the composer can't land underneath them
       after fullscreen/keyboard transitions.
       NOTE: Chat tab uses its own sizing rules and should NOT double-subtract tab height. */
    .dgc-dashboard-wrapper:not([data-active-tab="chat"]) .dgc-chat-container[data-dashboard-mode="1"]:not(.mobile-fullscreen) {
        --dgc-chat-outer-offset: var(--dgc-dashboard-tabs-total-height, 0px);
    }

    /* Chat tab (keyboard closed): reserve the bottom tabs height so background/input sit above the tabs. */
    .dgc-dashboard-wrapper[data-active-tab="chat"]:not(.dgc-keyboard-open) .dgc-chat-container[data-dashboard-mode="1"]:not(.mobile-fullscreen) {
        --dgc-chat-outer-offset: var(--dgc-dashboard-tabs-total-height, 0px);
    }

    /* Hide dashboard tabs only on Chat tab when keyboard is open */
    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-dashboard-tabs {
        display: none !important;
    }
    html.dgc-dashboard-fullscreen,
    body.dgc-dashboard-fullscreen {
        overflow: hidden;
        height: 100%;
    }
}

.dgc-dashboard-wrapper.is-fullscreen {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: auto;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* Paint the full-screen background at the wrapper level so non-chat tabs
       can never show the underlying page at the edges. */
    background: var(--dgc-dashboard-bg) !important;
    z-index: 999999;
    display: flex;
    flex-direction: column;
}

/* Always-fullscreen dashboard: force true edge-to-edge on all screens.
   This overrides the mobile "inset card" fullscreen behavior to keep the UX isolated. */
.dgc-dashboard-wrapper.dgc-dashboard-wrapper--always-fullscreen.is-fullscreen {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
}

/* Mobile fullscreen: remove rounded corners and insets for clean edge-to-edge overlay */
@media (max-width: 1023px) {
    .dgc-dashboard-wrapper.is-fullscreen {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        /* Height is determined by top:0; bottom:0 — always matches the layout
           viewport.  Do NOT use an explicit JS-driven height here because stale
           values during fullscreen transitions cause visible jump/push-up. */
        border-radius: 0;
    }

    .dgc-dashboard-wrapper.dgc-dashboard-wrapper--always-fullscreen.is-fullscreen {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        border-radius: 0;
    }

    /* Respect the WP admin bar in fullscreen mode.
       Height is auto (from base rule); top + bottom:0 sizes the wrapper correctly. */
    body.admin-bar .dgc-dashboard-wrapper.is-fullscreen {
        top: 32px;
    }

    body.admin-bar .dgc-dashboard-wrapper.dgc-dashboard-wrapper--always-fullscreen.is-fullscreen {
        top: 32px;
    }

    @media (max-width: 782px) {
        body.admin-bar .dgc-dashboard-wrapper.is-fullscreen {
            top: 46px;
        }

        body.admin-bar .dgc-dashboard-wrapper.dgc-dashboard-wrapper--always-fullscreen.is-fullscreen {
            top: 46px;
        }
    }
}

/* Respect the WP admin bar when logged in */
body.admin-bar .dgc-dashboard-wrapper.is-fullscreen {
    top: 32px;
    bottom: 0;
    height: auto;
}

@media (max-width: 782px) {
    body.admin-bar .dgc-dashboard-wrapper.is-fullscreen {
        top: 46px;
        bottom: 0;
        height: auto;
    }
}

/* When onboarding is incomplete, keep the underlying dashboard content non-interactive and visually hidden.
   The overlay remains usable, but the chat/dashboard UI should not appear before profile creation. */
.dgc-dashboard-wrapper[data-onboarding-complete="0"] .dgc-dashboard-header,
.dgc-dashboard-wrapper[data-onboarding-complete="0"] .dgc-dashboard-grid {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

/* Also hide dashboard content anytime the onboarding overlay is open.
   This prevents the chat interface from appearing behind/around the wizard. */
.dgc-dashboard-wrapper .dgc-onboarding-overlay.is-open ~ .dgc-dashboard-header,
.dgc-dashboard-wrapper .dgc-onboarding-overlay.is-open ~ .dgc-dashboard-grid {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

/* During onboarding, force-hide the right-panel tab rail even if mobile rules try to force it visible. */
.dgc-dashboard-wrapper[data-onboarding-complete="0"] .dgc-dashboard-right-panel,
.dgc-dashboard-wrapper--guest .dgc-dashboard-right-panel,
.dgc-dashboard-wrapper .dgc-onboarding-overlay.is-open ~ .dgc-dashboard-grid .dgc-dashboard-right-panel,
.dgc-dashboard-wrapper[data-onboarding-complete="0"] .dgc-dashboard-tabs,
.dgc-dashboard-wrapper--guest .dgc-dashboard-tabs,
.dgc-dashboard-wrapper .dgc-onboarding-overlay.is-open ~ .dgc-dashboard-grid .dgc-dashboard-tabs {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.dgc-dashboard-wrapper[data-onboarding-complete="0"] {
    min-height: min(900px, 100vh);
}

/* Onboarding/guest must occupy full viewport and not leave cut-off black areas. */
.dgc-dashboard-wrapper--guest,
.dgc-dashboard-wrapper[data-onboarding-complete="0"] {
    height: 100vh;
    min-height: 100vh;
    min-height: 100dvh;
}

.dgc-dashboard-wrapper[data-onboarding-complete="0"] .dgc-dashboard-footer,
.dgc-dashboard-wrapper .dgc-onboarding-overlay.is-open ~ .dgc-dashboard-footer,
.dgc-dashboard-wrapper--guest .dgc-dashboard-footer {
    display: none !important;
}

/* Guest dashboard has no header; let the main panel fill the viewport height. */
.dgc-dashboard-wrapper--guest .dgc-dashboard-main {
    min-height: 100vh;
}

.dgc-dashboard-wrapper.is-fullscreen[data-onboarding-complete="0"] {
    min-height: 100%;
}

.dgc-dashboard-wrapper.is-fullscreen::after {
    inset: 8px;
    border-radius: 0;
}

@media (min-width: 1024px) {
    /* Desktop: hide header on Chat tab (matches original UX expectation). */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-header {
        display: none;
    }
}

@media (max-width: 1023px) {
    /* Mobile: mirror desktop behavior and hide header on Chat tab only. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-header {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    /* Desktop Chat tab: fit dashboard to viewport so chat never overflows below the footer. */
    .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    body.admin-bar .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] {
        height: calc(100vh - 32px);
    }

    .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] .dgc-dashboard-grid {
        flex: 1 1 auto;
        min-height: 0;
    }

    /* In Chat tab, keep the footer in-flow so the phone fits exactly above it.
       Other tabs keep the “scroll behind sticky footer” behavior via padding-bottom. */
    .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] .dgc-dashboard-footer {
        position: relative;
        bottom: auto;
    }

    .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        padding: 0;
        overflow: hidden;
    }

    .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] .dgc-dashboard-sidebar,
    .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] .dgc-dashboard-right-panel {
        top: 0;
        max-height: calc(100vh - var(--dgc-dashboard-footer-height, 34px));
    }

    body.admin-bar .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] .dgc-dashboard-sidebar,
    body.admin-bar .dgc-dashboard-wrapper:not(.is-fullscreen)[data-active-tab="chat"] .dgc-dashboard-right-panel {
        max-height: calc(100vh - 32px - var(--dgc-dashboard-footer-height, 34px));
    }
}

/* Fullscreen: remove chrome (header + panels) and keep only content + close X */
@media (max-width: 1023px) {
    /* On small screens, fullscreen focuses on the main content. */
    .dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-sidebar {
        display: none;
    }

    .dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-main {
    padding: 0;
}

/* Desktop fullscreen should fit the viewport without changing the core 3-column layout. */
@media (min-width: 1024px) {
    .dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-sidebar,
    .dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-right-panel {
        display: flex;
    }

    .dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-grid.has-sidebar {
        grid-template-columns: 80px 1fr 300px;
    }
}

/* Fullscreen: content should fit the viewport width (avoid side gaps / centering clamps). */
.dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Dashboard-mode chat should never overflow its panel.
   Sizing (phone-style desktop vs full-screen mobile) is handled in the chat-tab section below. */
.dgc-dashboard-wrapper .dgc-chat-container[data-dashboard-mode="1"] {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

/* Hot-or-Not / Grid: unify with dashboard surfaces (avoid double frames/overlays). */
.dgc-dashboard-wrapper .dgc-hot-or-not {
    box-shadow: none;
    border: 1px solid var(--dgc-dashboard-border);
}

.dgc-dashboard-wrapper .dgc-hot-or-not::after {
    display: none;
}

@media (max-width: 768px) {
    /* hot-or-not.css sets border-radius:0 on mobile; keep dashboard rounded corners instead. */
    .dgc-dashboard-wrapper .dgc-hot-or-not {
        border-radius: var(--dgc-dashboard-radius-lg) !important;
    }
}

.dgc-dashboard-wrapper::after {
    content: none;
}

/* =========================================
   MAIN CONTENT BACKGROUND MEDIA (IN-PANEL)
   ======================================== */

/* The background media should live inside the main content container
   (where tab content appears), not behind the entire dashboard chrome. */
.dgc-dashboard-main {
    position: relative;
    overflow: hidden;
}

/* Scroll container sits above the background media */
.dgc-dashboard-main-scroll {
    position: relative;
    z-index: 1;
}

/* Optional background image/video layer (inside .dgc-dashboard-main) */
.dgc-dashboard-main .dgc-dashboard-bg-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.dgc-dashboard-main .dgc-dashboard-bg-media--image {
    background-color: transparent;
}

.dgc-dashboard-main .dgc-dashboard-bg-media--video video {
    width: 100%;
    height: 100%;
    display: block;
}

/* Allow enabling background only in fullscreen */
.dgc-dashboard-wrapper[data-bg-fullscreen-only="1"]:not(.is-fullscreen) .dgc-dashboard-main .dgc-dashboard-bg-media {
    display: none;
}

/* =========================================
   DASHBOARD HEADER
   ======================================== */

.dgc-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--dgc-dashboard-header-bg, rgba(9, 11, 18, 0.25));
    border-bottom: 1px solid var(--dgc-dashboard-border-subtle);
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    position: sticky;
    top: 0;
    z-index: 100;
}

.dgc-dashboard-header-center {
    display: none;
}

@media (max-width: 1023px) {
    .dgc-dashboard-header {
        padding: 12px 14px;
    }

    .dgc-dashboard-header-center {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        pointer-events: none;
        z-index: 1;
    }

    .dgc-dashboard-header-center img {
        display: block;
        max-height: 28px;
        width: auto;
        object-fit: contain;
    }

    .dgc-dashboard-user-details {
        display: none;
    }

    .dgc-mobile-menu-toggle {
        display: none !important;
    }

    .dgc-dashboard-avatar {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    .dgc-dashboard-balance {
        padding: 6px 10px;
        gap: 6px;
    }

    .dgc-dashboard-balance-amount {
        font-size: 14px;
    }

    .dgc-dashboard-balance-label {
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
    .dgc-dashboard-header-center {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        pointer-events: none;
        z-index: 1;
    }

    .dgc-dashboard-header-center img {
        display: block;
        max-height: 40px;
        width: auto;
        object-fit: contain;
        filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.10));
    }
}

.dgc-dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.dgc-mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--dgc-dashboard-border);
    color: var(--dgc-dashboard-text);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--dgc-dashboard-transition);
}

.dgc-mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dgc-dashboard-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dgc-dashboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 2px solid var(--dgc-dashboard-primary);
    object-fit: cover;
}

.dgc-dashboard-user-details {
    display: flex;
    flex-direction: column;
}

.dgc-dashboard-username {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dgc-dashboard-text);
}

.dgc-dashboard-user-email {
    font-size: 13px;
    color: var(--dgc-dashboard-text-secondary);
}

.dgc-dashboard-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dgc-dashboard-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 20, 147, 0.15), rgba(138, 43, 226, 0.15));
    border: 1px solid rgba(255, 20, 147, 0.3);
    border-radius: 999px;
}

.dgc-dashboard-coin-icon {
    width: 20px;
    height: 20px;
    display: block;
    flex: 0 0 auto;
}

.dgc-dashboard-balance-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--dgc-dashboard-text);
}

.dgc-dashboard-balance-label {
    font-size: 13px;
    color: var(--dgc-dashboard-text-secondary);
}

/* =========================================
   DASHBOARD FOOTER (1-line)
   ======================================== */

.dgc-dashboard-footer {
    --dgc-dashboard-footer-height: 34px;
    min-height: var(--dgc-dashboard-footer-height);
    height: var(--dgc-dashboard-footer-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dgc-dashboard-footer-bg, var(--dgc-dashboard-header-bg, rgba(9, 11, 18, 0.25)));
    border-top: 1px solid var(--dgc-dashboard-footer-border, var(--dgc-dashboard-border-subtle));
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    color: var(--dgc-dashboard-footer-text, var(--dgc-dashboard-text-secondary));
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Keep footer visible while content scrolls behind it. */
    position: sticky;
    bottom: 0;
    z-index: 120;
}

.dgc-dashboard-footer-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gmail in-app browser hint banner */
.dgc-open-browser-hint {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 12px);
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(10, 12, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(245, 245, 255, 0.95);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    z-index: 10050;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    text-align: center;
    max-width: min(90vw, 360px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.dgc-open-browser-hint.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* =========================================
   ONBOARDING WIZARD
   ======================================== */

.dgc-onboarding-overlay {
    /* Cover the viewport reliably on mobile (avoid parent height issues). */
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 36px);
    /* Safe area insets for iOS notch/home bar */
    padding-top: max(clamp(16px, 4vw, 36px), env(safe-area-inset-top, 0px));
    padding-bottom: max(clamp(16px, 4vw, 36px), env(safe-area-inset-bottom, 0px));
    padding-left: max(clamp(16px, 4vw, 36px), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(16px, 4vw, 36px), env(safe-area-inset-right, 0px));
    background: radial-gradient(120% 120% at 20% 10%, rgba(255, 92, 141, 0.18) 0%, rgba(9, 11, 18, 0.88) 55%, rgba(9, 11, 18, 0.94) 100%);
    backdrop-filter: blur(calc(var(--dgc-dashboard-blur) + 4px));
    -webkit-backdrop-filter: blur(calc(var(--dgc-dashboard-blur) + 4px));
    z-index: 11000;
    /* If the card gets taller than the viewport, allow the overlay itself to scroll. */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.dgc-onboarding-overlay.is-open {
    display: flex;
}

/* Welcome DreamCoins animation (finish step) */
.dgc-welcome-coins {
    margin-top: 16px;
    padding: 16px 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(255, 211, 106, 0.14), rgba(255, 92, 141, 0.10), rgba(102, 227, 255, 0.08));
    position: relative;
    overflow: hidden;
    text-align: center;
}

.dgc-welcome-coins-amount {
    font-size: clamp(34px, 5vw, 46px);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.dgc-welcome-coins-label {
    margin-top: 4px;
    font-weight: 800;
    opacity: 0.92;
}

.dgc-welcome-coins-sub {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(245, 245, 255, 0.74);
}

.dgc-welcome-coins-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dgc-welcome-coin {
    position: absolute;
    left: 50%;
    top: 52%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -9px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.2) 30%, rgba(0,0,0,0) 55%),
        linear-gradient(135deg, #ffd36a, #ffb300);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
    transform: translate(0, 0) rotate(0deg) scale(0.9);
    opacity: 0;
    animation: dgcCoinBurst 980ms cubic-bezier(.16,.84,.22,1) forwards;
    animation-delay: var(--delay, 0ms);
}

@keyframes dgcCoinBurst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.7);
        opacity: 0;
        filter: blur(0px);
    }
    12% {
        opacity: 1;
        transform: translate(calc(var(--dx, 0px) * 0.18), calc(var(--dy, 0px) * 0.18)) rotate(calc(var(--rot, 0deg) * 0.2)) scale(1);
    }
    55% {
        opacity: 1;
        transform: translate(calc(var(--dx, 0px) * 0.7), calc(var(--dy, 0px) * 0.7)) rotate(calc(var(--rot, 0deg) * 0.7)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--rot, 0deg)) scale(0.85);
        filter: blur(0.3px);
    }
}

.dgc-onboarding-card {
    width: min(720px, 94vw);
    border-radius: var(--dgc-dashboard-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(14, 16, 26, 0.85) 0%, rgba(10, 12, 20, 0.70) 100%);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
    overflow: visible;
    animation: dgcOnbPop 220ms ease;
    display: flex;
    flex-direction: column;
    /* Let overlay handle scrolling so the wizard can use full height without inner cutoff. */
    max-height: none;
}

.dgc-dashboard-wrapper.is-fullscreen .dgc-onboarding-overlay {
    align-items: flex-start;
    justify-content: center;
    padding: 8px;
}

.dgc-dashboard-wrapper.is-fullscreen .dgc-onboarding-card {
    width: min(720px, 94vw);
    max-width: none;
}

@media (min-width: 1024px) {
    .dgc-onboarding-card {
        width: min(640px, 68vw);
    }
}

@keyframes dgcOnbPop {
    from { transform: translateY(10px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.dgc-onboarding-header {
    padding: 22px 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(255, 92, 141, 0.14), rgba(102, 227, 255, 0.10));
    flex-shrink: 0;
}

.dgc-onboarding-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.20);
    color: rgba(245, 245, 255, 0.9);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.dgc-onboarding-badge--success {
    border-color: rgba(102, 227, 255, 0.35);
    background: rgba(102, 227, 255, 0.10);
}

.dgc-onboarding-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.dgc-onboarding-logo img {
    max-width: min(240px, 70%);
    max-height: 72px;
    width: auto;
    height: auto;
    display: block;
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dgc-onboarding-logo-fallback {
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 245, 255, 0.92);
}

.dgc-onboarding-title {
    margin: 14px 0 6px;
    font-size: clamp(20px, 3.2vw, 28px);
    font-weight: 800;
}

.dgc-onboarding-subtitle {
    margin: 0;
    color: rgba(245, 245, 255, 0.72);
    font-size: 14px;
}

.dgc-onboarding-progress {
    margin-top: 14px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.dgc-onboarding-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff5c8d 0%, #66e3ff 100%);
    transition: width 220ms ease;
}

.dgc-onboarding-body {
    padding: 18px 22px 14px;
    overflow: visible;
    flex: 1 1 auto;
    min-height: 0;
}

/* Hide scrollbar visuals (keep scroll functionality) */
.dgc-onboarding-body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge Legacy */
}

.dgc-onboarding-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

@media (max-width: 480px) {
    .dgc-onboarding-header {
        padding: 16px 14px 10px;
    }
    .dgc-onboarding-body {
        padding: 12px 14px 10px;
    }
    .dgc-onboarding-footer {
        padding: 12px 14px 16px;
    }
    .dgc-onboarding-title {
        font-size: 18px;
        margin: 10px 0 4px;
    }
    .dgc-onboarding-subtitle {
        font-size: 13px;
    }
    .dgc-onboarding-logo img {
        max-width: 180px;
        max-height: 56px;
    }
    .dgc-onboarding-progress {
        margin-top: 10px;
        height: 8px;
    }
    .dgc-onboarding-perks li {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Extra small mobile screens - ensure footer is always visible */
@media (max-height: 600px) {
    .dgc-onboarding-overlay {
        align-items: flex-start;
        padding: 12px;
    }
    .dgc-onboarding-card {
        max-height: none;
    }
    .dgc-onboarding-header {
        padding: 12px 14px 8px;
    }
    .dgc-onboarding-body {
        padding: 10px 14px 8px;
        flex: 1 1 auto;
        min-height: 0;
    }
    .dgc-onboarding-footer {
        flex-shrink: 0;
        padding: 10px 14px 14px;
    }
    .dgc-onboarding-title {
        font-size: 16px;
        margin: 8px 0 2px;
    }
    .dgc-onboarding-subtitle {
        font-size: 12px;
    }
    .dgc-onboarding-logo {
        margin-bottom: 6px;
    }
    .dgc-onboarding-logo img {
        max-width: 140px;
        max-height: 44px;
    }
    .dgc-onboarding-progress {
        margin-top: 8px;
        height: 6px;
    }
    .dgc-onboarding-copy {
        margin-bottom: 10px;
        font-size: 14px;
    }
    .dgc-onboarding-perks {
        gap: 8px;
    }
    .dgc-onboarding-perks li {
        padding: 8px 10px;
        font-size: 13px;
    }
    .dgc-onboarding-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Landscape mode on phones - ultra compact to ensure button visibility */
@media (max-height: 450px) and (orientation: landscape) {
    .dgc-onboarding-overlay {
        align-items: flex-start;
        padding: 8px;
    }
    .dgc-onboarding-card {
        max-height: none;
    }
    .dgc-onboarding-header {
        padding: 8px 12px 6px;
    }
    .dgc-onboarding-body {
        padding: 8px 12px 6px;
    }
    .dgc-onboarding-footer {
        padding: 8px 12px;
    }
    .dgc-onboarding-title {
        font-size: 15px;
        margin: 4px 0 2px;
    }
    .dgc-onboarding-subtitle {
        font-size: 11px;
    }
    .dgc-onboarding-logo {
        display: none;
    }
    .dgc-onboarding-progress {
        margin-top: 6px;
        height: 4px;
    }
    .dgc-onboarding-perks {
        gap: 6px;
    }
    .dgc-onboarding-perks li {
        padding: 6px 8px;
        font-size: 12px;
    }
    .dgc-onboarding-btn {
        padding: 8px 10px;
        font-size: 13px;
    }
}

.dgc-onboarding-step {
    display: none;
}

.dgc-onboarding-step.is-active {
    display: block;
}

.dgc-onboarding-copy {
    margin: 0 0 14px;
    color: rgba(245, 245, 255, 0.86);
}

.dgc-onboarding-perks {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.dgc-onboarding-perks li {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.16);
}

.dgc-onboarding-label {
    display: block;
    margin: 0 0 8px;
    font-weight: 700;
    color: rgba(245, 245, 255, 0.9);
}

.dgc-onboarding-input {
    width: 100%;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.22);
    color: var(--dgc-dashboard-text);
    outline: none;
}

/* Onboarding nickname: ensure readable text on mobile/themes that restyle inputs. */
#dgc-onb-nickname {
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
}

#dgc-onb-nickname::placeholder {
    color: rgba(17, 17, 17, 0.55) !important;
}

.dgc-onboarding-input:focus {
    border-color: rgba(255, 92, 141, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 92, 141, 0.16);
}

.dgc-onboarding-help {
    margin: 10px 0 0;
    color: rgba(245, 245, 255, 0.65);
    font-size: 13px;
}

.dgc-onboarding-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 720px) {
    .dgc-onboarding-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.dgc-onboarding-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dgc-onboarding-pill {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.18);
    color: rgba(245, 245, 255, 0.92);
    padding: 10px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.dgc-onboarding-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(102, 227, 255, 0.32);
}

.dgc-onboarding-pill.is-selected,
.dgc-onboarding-pill[aria-pressed="true"] {
    border-color: rgba(255, 92, 141, 0.55);
    background: rgba(255, 92, 141, 0.16);
}

.dgc-onboarding-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
}

.dgc-onboarding-check input {
    margin-top: 2px;
}

.dgc-onboarding-error {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 92, 141, 0.45);
    background: rgba(255, 92, 141, 0.14);
    color: rgba(245, 245, 255, 0.95);
}

.dgc-onboarding-notice {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    line-height: 1.35;
}

.dgc-onboarding-footer {
    padding: 14px 22px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.dgc-onboarding-actions {
    display: flex;
    gap: 10px;
}

.dgc-onboarding-btn {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.18);
    color: rgba(245, 245, 255, 0.95);
    cursor: pointer;
}

.dgc-onboarding-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dgc-onboarding-btn--primary {
    border-color: rgba(255, 92, 141, 0.55);
    background: linear-gradient(135deg, rgba(255, 92, 141, 0.35), rgba(138, 43, 226, 0.25));
}

.dgc-onboarding-btn--ghost {
    background: transparent;
}

.dgc-onboarding-skip {
    background: transparent;
    border: none;
    color: rgba(245, 245, 255, 0.65);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.dgc-onboarding-finish {
    text-align: center;
    padding: 10px 0;
}

.dgc-onboarding-finish h3 {
    margin: 14px 0 6px;
}

.dgc-onboarding-woo {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.16);
    padding: 14px;
}


/* =========================================
   MAIN DASHBOARD GRID - DESKTOP
   ======================================== */

.dgc-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;

    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Allow grid items to shrink without forcing horizontal scroll. */
.dgc-dashboard-sidebar,
.dgc-dashboard-main,
.dgc-dashboard-right-panel {
    min-width: 0;
}

.dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: 1fr;
}

.dgc-dashboard-grid.has-sidebar {
    grid-template-columns: 80px 1fr 60px;
}

@media (min-width: 1024px) {
    .dgc-dashboard-grid.has-sidebar {
        grid-template-columns: 80px 1fr 300px;
    }
}

/* =========================================
   SIDEBAR - RECENT CHATS
   ======================================== */

.dgc-dashboard-sidebar {
    background: var(--dgc-dashboard-sidebar-bg, rgba(12, 14, 22, 0.35));
    border-right: 1px solid var(--dgc-dashboard-border-subtle);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: sticky;
    top: 80px;
    height: auto;
    max-height: calc(100vh - 80px);
}

.dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-sidebar {
    position: relative;
    top: auto;
    height: 100%;
    min-height: 0;
}

/* Hide scrollbar visuals (keep scroll functionality) */
.dgc-dashboard-sidebar,
.dgc-recent-chats-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge Legacy */
}

.dgc-dashboard-sidebar::-webkit-scrollbar,
.dgc-recent-chats-container::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.dgc-sidebar-header {
    padding: 15px 10px;
    border-bottom: 1px solid var(--dgc-dashboard-border-subtle);
}

.dgc-sidebar-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dgc-dashboard-text-secondary);
    text-align: center;
}

.dgc-recent-chats-container {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
}

.dgc-recent-chat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    cursor: pointer;
    border-radius: 12px;
    transition: var(--dgc-dashboard-transition);
    position: relative;
    margin-bottom: 10px;
}

.dgc-recent-chat-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dgc-recent-chat-item.active {
    background: rgba(255, 20, 147, 0.15);
}

.dgc-recent-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    border: 2px solid var(--dgc-dashboard-border);
    object-fit: cover;
}

.dgc-recent-chat-item.active .dgc-recent-chat-avatar {
    border-color: var(--dgc-dashboard-primary);
}

.dgc-recent-chat-name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dgc-recent-chat-unread {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--dgc-contacts-badge-bg, var(--dgc-dashboard-primary));
    color: var(--dgc-contacts-badge-text, #fff) !important;
    -webkit-text-fill-color: var(--dgc-contacts-badge-text, #fff) !important;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.dgc-recent-chats-empty {
    text-align: center;
    padding: 30px 10px;
    color: var(--dgc-dashboard-text-secondary);
    font-size: 13px;
}

/* =========================================
   MAIN CONTENT AREA
   ======================================== */

.dgc-dashboard-main {
    background: var(--dgc-dashboard-bg);
    padding: 0;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-main {
    min-height: 0;
    height: 100%;
}

/* Hide scrollbar visuals (keep scroll functionality) */
.dgc-dashboard-main-scroll {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge Legacy */
}

.dgc-dashboard-main-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.dgc-dashboard-main-scroll {
    flex: 1 1 auto;
    min-height: 0;
    --dgc-dashboard-scroll-padding: clamp(12px, 3vw, 20px);
    padding: var(--dgc-dashboard-scroll-padding);
    overflow-y: auto;
}

/* Desktop: reserve space so long tab content never overlays the sticky footer. */
@media (min-width: 1024px) {
    .dgc-dashboard-main-scroll {
        padding-bottom: calc(var(--dgc-dashboard-scroll-padding) + var(--dgc-dashboard-footer-height, 34px));
    }
}

.dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-main-scroll {
    min-height: 0;
    --dgc-dashboard-scroll-padding: 16px;
    padding: var(--dgc-dashboard-scroll-padding);
}

.dgc-dashboard-tab-content {
    display: none;
    animation: dgcFadeIn 0.3s ease;
}

.dgc-dashboard-tab-content.active {
    display: block;
}

/* Chat tab layout:
   - Desktop: keep the phone-style chat centered (like standalone), not full-bleed.
   - Mobile: true edge-to-edge above bottom tabs (handled in mobile section). */
.dgc-dashboard-main-scroll > .dgc-dashboard-tab-content.dgc-tab-chat.active {
    margin: 0;
    padding: clamp(8px, 2vw, 16px);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
}

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

/* Desktop dashboard chat: keep the original phone-style size and center it.
   (chat.css already sets 375x667; we just make sure it can shrink if needed). */
.dgc-dashboard-wrapper .dgc-tab-chat .dgc-chat-container[data-dashboard-mode="1"] {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

@media (min-width: 1024px) {
    /* Desktop Chat tab: treat the main panel as a fixed-height viewport region.
       The chat “phone” should expand to fill the available height. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        padding: 0;
        overflow: hidden;
    }

    /* Desktop: add rounded corners to chat interface for phone-style appearance */
    .dgc-dashboard-wrapper .dgc-chat-container[data-dashboard-mode="1"] {
        border-radius: 30px !important;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content.dgc-tab-chat.active {
        padding: 0;
        height: 100%;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-tab-chat.active .dgc-chat-container[data-dashboard-mode="1"] {
        height: 100%;
        max-height: 100%;
        aspect-ratio: 9 / 16;
        width: auto;
        max-width: min(520px, 100%);
        border-radius: 30px;
    }

    /* Desktop fullscreen chat: prevent outer scrolling (messages still scroll inside chat UI). */
    .dgc-dashboard-wrapper.is-fullscreen[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        overflow: hidden !important;
        padding: 0 !important;
    }

    .dgc-dashboard-wrapper.is-fullscreen[data-active-tab="chat"] .dgc-dashboard-tab-content.dgc-tab-chat.active {
        overflow: hidden !important;
    }
}

/* Mobile/tablet dashboard chat: reinstate full-screen style (no small square card). */
@media (max-width: 1023px) {
    .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content.dgc-tab-chat.active {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        width: 100%;
    }

    .dgc-dashboard-wrapper .dgc-tab-chat.active .dgc-chat-container[data-dashboard-mode="1"]:not(.mobile-fullscreen) {
        width: 100%;
        max-width: 100%;
        margin: 0;
        /* The chat tab pane is already sized above the bottom tabs; fill it. */
        height: 100% !important;
        max-height: 100% !important;
        border: 0;
        box-shadow: none;
        /* Non-fullscreen: chat UI keeps its rounded corners (one unified layout). */
        border-radius: clamp(20px, 5vw, 30px);
    }

    /* When keyboard opens, maintain the same container height */
    .dgc-dashboard-wrapper.dgc-keyboard-open .dgc-tab-chat.active .dgc-chat-container[data-dashboard-mode="1"]:not(.mobile-fullscreen) {
        height: 100% !important;
        max-height: 100% !important;
    }
}

/* =========================================
   CHAT + PROFILE SPLIT (Dashboard)
   - Desktop: Chat left, Profile right
   - Mobile: swipe sideways between panels
   ======================================== */

.dgc-dashboard-tab-content.dgc-tab-chat .dgc-dashboard-chat-split {
    width: 100%;
    min-height: 0;
    position: relative;
}

/* Mobile swipe hint (tap chat -> show hint). */

.dgc-dashboard-swipe-hint {
    position: fixed !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    color: #fff !important;
    font-size: 32px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    letter-spacing: -4px !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
    display: block !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

.dgc-dashboard-swipe-hint.dgc-swipe-blink {
    animation: dgc-swipe-blink-pulse 1.2s infinite ease-in-out;
}

@keyframes dgc-swipe-blink-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@media (max-width: 1023px) {
    /* In mobile chat fullscreen, show the hint centered rather than near the composer area. */
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen[data-active-tab="chat"] .dgc-dashboard-swipe-hint {
        top: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
    }

    /* While typing, hide it to avoid layout/overlay conflicts. */
    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-dashboard-swipe-hint {
        display: none;
    }
}

@media (min-width: 1024px) {
    /* Hide swipe hint on desktop where swiping doesn't apply. */
    .dgc-dashboard-swipe-hint {
        display: none !important;
    }
    
    /* Override the old centered phone layout when using the split container. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content.dgc-tab-chat.active {
        justify-content: stretch;
        align-items: stretch;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 16px;
        height: 100%;
        padding: 16px;
        overflow: hidden;
    }

    /* Keep the original chat "phone" size; profile uses remaining space. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chat-container[data-dashboard-mode="1"]:not(.desktop-fullscreen) {
        flex: 0 0 auto;
        margin: 0;
        width: clamp(320px, 33vw, 400px);
        height: 100% !important;
        max-height: 100% !important;
        /* Override base aspect-ratio sizing so split panes align perfectly. */
        aspect-ratio: auto !important;
        max-width: 100%;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-dashboard-profile-pane {
        flex: 1 1 auto;
        min-width: 0;
        height: 100%;
        max-height: 100%;
        margin: 0;
        /* Keep the pane fixed; only the Bio section scrolls (see rules below). */
        overflow: hidden;
        border-radius: var(--dgc-dashboard-radius);
        background: var(--dgc-dashboard-card-bg);
        border: 1px solid var(--dgc-dashboard-border);
        box-shadow: 0 18px 45px rgba(8, 10, 20, 0.35);
        backdrop-filter: blur(var(--dgc-dashboard-blur));
        -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    }

    /* Desktop Chat tab profile pane: make Bio scroll inside its own container (no visible scrollbar). */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard {
        flex: 1 1 auto;
        min-height: 0;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-top,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-left,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-right {
        height: 100%;
        min-height: 0;
    }

    /* Left column: let portrait grow to fill remaining height so Media bottom aligns with Bio bottom. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-left {
        display: flex;
        flex-direction: column;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-portrait-link,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-portrait-frame,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-portrait--empty {
        flex: 1 1 auto;
        min-height: 0;
        display: block;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-portrait {
        height: 100%;
        max-height: none;
        object-position: center top;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-portrait-frame > .dgc-profile-dashboard-portrait {
        object-position: center top;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-media {
        flex: 0 0 auto;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-bio {
        margin-top: 4px !important;
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-bio .dgc-profile-panel-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge Legacy */
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-bio .dgc-profile-panel-content::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer img,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer video,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-dashboard-profile-pane img,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-dashboard-profile-pane video {
        max-width: 100%;
        height: auto;
    }

    /* Hide scrollbar visuals in profile panes (scroll still works). */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-dashboard-profile-pane {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer::-webkit-scrollbar,
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-dashboard-profile-pane::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    /* In split mode, treat the drawer as a panel (always visible). */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-toggle {
        display: none !important;
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer-body {
        padding: 14px;
    }
}

@media (max-width: 1023px) {
    .dgc-dashboard-tab-content.dgc-tab-chat .dgc-dashboard-chat-split {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        height: 100%;
        min-height: 0;
        position: relative;
    }

    .dgc-dashboard-tab-content.dgc-tab-chat .dgc-dashboard-chat-split > * {
        flex: 0 0 100%;
        width: 100%;
        scroll-snap-align: start;
        height: 100%;
        min-height: 0;
        position: relative;
    }

    /* In swipe mode, make chat input scroll with its container (not fixed) when keyboard is closed */
    .dgc-dashboard-wrapper[data-active-tab="chat"]:not(.dgc-keyboard-open) .dgc-dashboard-tab-content.dgc-tab-chat .dgc-dashboard-chat-split .dgc-chat-container[data-dashboard-mode="1"] .dgc-chat-input {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10 !important;
    }

    /* Make the profile pane match chat height on mobile. */
    .dgc-dashboard-tab-content.dgc-tab-chat .dgc-dashboard-profile-pane,
    .dgc-dashboard-tab-content.dgc-tab-chat .dgc-chatbot-profile-drawer {
        height: 100%;
        max-height: none;
        min-height: 0;
        margin: 0;
        overflow-y: auto;
        overflow-x: hidden;
        background: var(--dgc-dashboard-bg);
        border-radius: 0;
        border: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        /* Prevent notch/status-bar clipping when the dashboard header is hidden on mobile. */
        padding-top: max(12px, env(safe-area-inset-top, 0px));
        /* Prevent bottom content being clipped (home indicator / momentum scroll). */
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        scroll-padding-top: max(12px, env(safe-area-inset-top, 0px));
        scroll-padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    /* Edge-to-edge chat fullscreen: keep profile content out of the status bar/notch area. */
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen[data-active-tab="chat"] .dgc-dashboard-tab-content.dgc-tab-chat .dgc-dashboard-profile-pane,
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen[data-active-tab="chat"] .dgc-dashboard-tab-content.dgc-tab-chat .dgc-chatbot-profile-drawer {
        padding-top: max(12px, env(safe-area-inset-top, 0px));
        box-sizing: border-box;
        scroll-padding-top: max(12px, env(safe-area-inset-top, 0px));
    }

    /* In mobile swipe mode, keep the bot profile body visible. */
    .dgc-dashboard-tab-content.dgc-tab-chat .dgc-chatbot-profile-toggle {
        display: none !important;
    }
}

/* Guest dashboard (login/register): show Woo form full-width with no themed card background. */
.dgc-dashboard-wrapper--guest .dgc-onboarding-overlay {
    /* IMPORTANT: the guest login must be scrollable and never cut off. */
    position: relative;
    inset: auto;
    min-height: 100%;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    align-items: stretch;
    justify-content: stretch;
    overflow: auto;
}

.dgc-dashboard-wrapper--guest .dgc-onboarding-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.dgc-dashboard-wrapper--guest .dgc-onboarding-header,
.dgc-dashboard-wrapper--guest .dgc-onboarding-footer {
    display: none;
}

.dgc-dashboard-wrapper--guest .dgc-onboarding-body {
    padding: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.dgc-dashboard-wrapper--guest .dgc-onboarding-woo {
    border-radius: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

/* WooCommerce auth/account embeds: remove theme centering constraints inside the guest dashboard. */
.dgc-dashboard-wrapper--guest .woocommerce,
.dgc-dashboard-wrapper--guest .woocommerce-page,
.dgc-dashboard-wrapper--guest .woocommerce-account,
.dgc-dashboard-wrapper--guest .woocommerce form,
.dgc-dashboard-wrapper--guest .woocommerce .woocommerce-MyAccount-content,
.dgc-dashboard-wrapper--guest .woocommerce .woocommerce-MyAccount-navigation,
.dgc-dashboard-wrapper--guest .woocommerce .u-column1,
.dgc-dashboard-wrapper--guest .woocommerce .u-column2 {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Chatbot profile drawer (below chat) */
.dgc-chatbot-profile-drawer {
    margin: 14px auto 0;
    max-width: 100%;
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    position: relative;
    overflow: hidden;
}

/* In the dashboard, the chatbot profile lives in the Profile tab (not below chat). */
.dgc-dashboard-wrapper:not([data-active-tab="chat"]) .dgc-chatbot-profile-drawer {
    display: none !important;
}

/* Dashboard chat split: the chatbot profile is shown next to chat. */
.dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-chat-split .dgc-chatbot-profile-drawer {
    display: block !important;
}

.dgc-chatbot-profile-drawer::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: clamp(0px, calc(var(--dgc-dashboard-radius-lg) - 4px), 999px);
    border: 1px solid var(--dgc-dashboard-border-subtle);
    pointer-events: none;
}

.dgc-chatbot-profile-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: transparent;
    color: var(--dgc-dashboard-text);
    border: 0;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.dgc-chatbot-profile-toggle-label {
    font-weight: 800;
    letter-spacing: 0.2px;
}

.dgc-chatbot-profile-toggle-hint {
    margin-left: auto;
    font-size: 12px;
    color: var(--dgc-dashboard-text-secondary);
}

.dgc-chatbot-profile-toggle-caret {
    transition: transform 0.2s ease;
    opacity: 0.85;
}

.dgc-chatbot-profile-drawer.is-open .dgc-chatbot-profile-toggle-caret {
    transform: rotate(180deg);
}

.dgc-chatbot-profile-drawer-body {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--dgc-dashboard-border-subtle);
    padding: 14px 14px 16px;
}

/* Keep embedded chatbot profile from feeling "double framed" */
.dgc-chatbot-profile-drawer-body .dgc-profile-shell {
    margin: 0;
}

/* Discover and Browse tabs */
.dgc-discover-tab-inner,
.dgc-browse-tab-inner {
    max-width: 100%;
    /* Ensure proper content sizing */
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dgc-discover-tab-inner .dgc-hot-or-not,
.dgc-browse-tab-inner .dgc-hot-grid {
    margin: 0;
    max-width: none;
    width: 100%;
    /* Allow content to grow and maintain scroll */
    flex: 1 1 auto;
}

/* Profile tab */
.dgc-profile-tab-inner {
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    padding: 30px;
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    position: relative;
    overflow: hidden;
}

/* Profile tab: the embedded profile shell should not add extra outer margins. */
.dgc-profile-tab-inner .dgc-profile-shell {
    margin: 0;
    width: 100%;
    max-width: 100%;
}

/* User profile action row (chat profile pane) */
.dgc-profile-action-row{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 12px;
}

.dgc-profile-action-btn{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--dgc-dashboard-border);
    background: rgba(0, 0, 0, 0.18);
    color: inherit;
    border-radius: 999px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background var(--dgc-dashboard-transition), border-color var(--dgc-dashboard-transition);
}

.dgc-profile-action-btn:hover{
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.dgc-profile-action-btn .dashicons{
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.dgc-profile-action-label{
    font-weight: 700;
    letter-spacing: 0.2px;
}

.dgc-profile-tab-inner::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: clamp(0px, calc(var(--dgc-dashboard-radius-lg) - 4px), 999px);
    border: 1px solid var(--dgc-dashboard-border-subtle);
    pointer-events: none;
}

.dgc-profile-display {
    text-align: center;
}

.dgc-profile-display-avatar {
    width: 120px;
    height: 120px;
    border-radius: 18px;
    border: 3px solid var(--dgc-dashboard-primary);
    margin: 0 auto 20px;
    object-fit: cover;
}

.dgc-profile-display-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.dgc-profile-display-bio {
    font-size: 15px;
    color: var(--dgc-dashboard-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.dgc-profile-display-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 13px;
    color: var(--dgc-dashboard-text-secondary);
}

/* Transactions tab */
.dgc-transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dgc-transactions-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.dgc-transaction-filter {
    padding: 8px 16px;
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: 8px;
    color: var(--dgc-dashboard-text);
    font-size: 14px;
}

.dgc-transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dgc-transactions-collapsible {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.dgc-transactions-collapsible.is-open {
    display: flex;
}

.dgc-transactions-toggle {
    align-self: flex-start;
    padding: 10px 16px;
    border: 1px dashed var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius);
    background: var(--dgc-dashboard-card-bg);
    color: var(--dgc-dashboard-text);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dgc-transactions-toggle:hover {
    background: var(--dgc-dashboard-border-subtle, var(--dgc-dashboard-border));
    border-color: var(--dgc-dashboard-border);
}

.dgc-transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius);
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
}

.dgc-transaction-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dgc-transaction-type {
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
}

.dgc-transaction-date {
    font-size: 12px;
    color: var(--dgc-dashboard-text-secondary);
}

.dgc-transaction-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.dgc-transaction-amount {
    font-size: 16px;
    font-weight: 700;
}

.dgc-transaction-amount.positive {
    color: #4ade80;
}

.dgc-transaction-amount.negative {
    color: #f87171;
}

.dgc-transaction-balance {
    font-size: 12px;
    color: var(--dgc-dashboard-text-secondary);
}

.dgc-transactions-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--dgc-dashboard-text-secondary);
}

/* Account tab */
.dgc-account-tab-inner {
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    padding: 30px;
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
}

.dgc-account-daily {
    margin: 14px 0 22px;
    padding: 14px 16px;
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    background: var(--dgc-dashboard-card-bg-solid);
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
}

.dgc-account-daily-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.dgc-account-daily-body {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.dgc-account-daily-status {
    flex: 1;
    min-width: 220px;
    font-size: 13px;
    color: var(--dgc-dashboard-text-secondary);
}

.dgc-account-daily [data-dgc-daily-checkin][disabled] {
    opacity: 0.72;
    cursor: not-allowed;
}

/* Guided tour popup */
.dgc-tour-overlay {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: var(--dgc-dashboard-right-bg, rgba(12, 14, 22, 0.35));
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
}

.dgc-tour-card {
    width: min(460px, 100%);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    background: var(--dgc-dashboard-card-bg-solid);
    box-shadow: var(--dgc-dashboard-shadow);
    padding: 18px 18px 16px;
    text-align: center;
}

.dgc-tour-title {
    font-size: 16px;
    font-weight: 900;
    margin: 0 0 12px;
}

.dgc-account-tab-inner .dgc-profile-preview {
    display: block;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    background: var(--dgc-dashboard-card-bg);
}

.dgc-account-tab-inner .dgc-profile-preview .dgc-profile-overlay-inner {
    height: auto;
}

.dgc-account-tab-inner .dgc-profile-preview .dgc-profile-cover {
    min-height: 260px;
    height: auto;
}

.dgc-woo-account-embed {
    /* Reset WooCommerce styles to match dashboard theme */
    color: var(--dgc-dashboard-text);
}

/* =========================================
   RIGHT PANEL - TABS
   ======================================== */

.dgc-dashboard-right-panel {
    background: var(--dgc-dashboard-right-bg, rgba(12, 14, 22, 0.35));
    border-left: 1px solid var(--dgc-dashboard-border-subtle);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow: hidden;
}

.dgc-dashboard-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 10px;
}

.dgc-tab-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--dgc-dashboard-text-secondary);
    cursor: pointer;
    transition: var(--dgc-dashboard-transition);
    font-size: 11px;
    font-weight: 600;
}

.dgc-tab-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.dgc-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--dgc-dashboard-text);
}

.dgc-tab-btn.active {
    background: rgba(255, 20, 147, 0.15);
    border-color: var(--dgc-dashboard-primary);
    color: var(--dgc-dashboard-primary);
}

.dgc-tab-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--dgc-contacts-badge-bg, rgba(255, 20, 147, 0.92));
    color: var(--dgc-contacts-badge-text, #fff) !important;
    -webkit-text-fill-color: var(--dgc-contacts-badge-text, #fff) !important;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.dgc-contacts-tab-inner {
    padding: 12px;
}

.dgc-contacts-subnav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 14px;
}

.dgc-contacts-subtab-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.18);
    color: rgba(255,255,255,0.92);
    cursor: pointer;
    font-weight: 700;
}

.dgc-contacts-subtab-btn.is-active,
.dgc-contacts-subtab-btn[aria-selected="true"] {
    background: rgba(255, 20, 147, 0.12);
    border-color: rgba(255, 20, 147, 0.42);
    color: #fff;
}

.dgc-contacts-subtab-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--dgc-contacts-badge-bg, rgba(255, 20, 147, 0.92));
    color: var(--dgc-contacts-badge-text, #fff) !important;
    -webkit-text-fill-color: var(--dgc-contacts-badge-text, #fff) !important;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dgc-contacts-subpanels {
    display: block;
}

.dgc-contacts-subpanel[hidden] {
    display: none;
}

.dgc-contacts-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dgc-contacts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 1024px) {
    .dgc-contacts-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.dgc-contacts-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px;
}

.dgc-contacts-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.dgc-contacts-panel-header h4 {
    margin: 0;
}

.dgc-contacts-panel-count {
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 20, 147, 0.18);
    border: 1px solid rgba(255, 20, 147, 0.45);
    color: rgba(255, 20, 147, 0.95);
    font-weight: 800;
    line-height: 22px;
    text-align: center;
}

.dgc-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dgc-contacts-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.10);
}

.dgc-contacts-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
}

.dgc-contacts-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dgc-contacts-name {
    font-weight: 800;
}

.dgc-contacts-sub {
    font-size: 12px;
    opacity: 0.85;
}

.dgc-contacts-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dgc-contacts-status {
    font-size: 12px;
    opacity: 0.85;
    padding: 2px 6px;
}

.dgc-contacts-empty {
    opacity: 0.85;
    padding: 10px;
}

@media (min-width: 1024px) {
    .dgc-dashboard-tabs {
        padding: 20px 15px;
    }
    
    .dgc-tab-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .dgc-tab-label {
        display: block;
    }
}

/* =========================================
   PROFILE EDITOR
   ======================================== */

.dgc-profile-editor {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: clamp(18px, 2.2vw, 32px);
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.dgc-profile-editor::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: clamp(0px, calc(var(--dgc-dashboard-radius-lg) - 4px), 999px);
    border: 1px solid var(--dgc-dashboard-border-subtle);
    pointer-events: none;
}

.dgc-profile-editor > * {
    position: relative;
    z-index: 1;
}

.dgc-profile-editor h2 {
    font-size: 24px;
    margin-bottom: 30px;
}

.dgc-profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.dgc-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--dgc-dashboard-text);
}

.dgc-form-group input,
.dgc-form-group textarea {
    padding: 12px;
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: 8px;
    color: var(--dgc-dashboard-text);
    font-size: 14px;
    font-family: inherit;
}

.dgc-form-group input:focus,
.dgc-form-group textarea:focus {
    outline: none;
    border-color: var(--dgc-dashboard-primary);
}

.dgc-field-description {
    font-size: 12px;
    color: var(--dgc-dashboard-text-secondary);
    margin: 0;
}

.dgc-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.dgc-form-actions .dgc-btn-link {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .dgc-form-actions {
        gap: 8px;
    }

    .dgc-form-actions .dgc-btn-secondary,
    .dgc-form-actions .dgc-btn-link {
        padding-left: 12px;
        padding-right: 12px;
    }
}

.dgc-btn-primary,
.dgc-btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--dgc-dashboard-transition);
    border: none;
}

.dgc-btn-primary {
    background: linear-gradient(135deg, var(--dgc-dashboard-primary), var(--dgc-dashboard-secondary));
    color: white;
}

.dgc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3);
}

.dgc-btn-secondary {
    background: transparent;
    border: 1px solid var(--dgc-dashboard-border);
    color: var(--dgc-dashboard-text);
}

.dgc-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dgc-form-message {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.dgc-form-message.info {
    display: block;
    background: rgba(96, 165, 250, 0.14);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.35);
}

.dgc-form-message.success {
    display: block;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.dgc-form-message.error {
    display: block;
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.dgc-upload-status {
    margin-top: 8px;
    font-size: 13px;
    color: var(--dgc-dashboard-text-secondary);
}

.dgc-upload-preview {
    margin-top: 10px;
}

.dgc-upload-thumb {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    border: 1px solid var(--dgc-dashboard-border);
    object-fit: cover;
    background: rgba(0, 0, 0, 0.25);
}

.dgc-upload-thumb--cover {
    width: 140px;
    height: 84px;
    background-size: cover;
    background-position: center;
}

.dgc-upload-thumb--empty {
    background: rgba(255, 255, 255, 0.04);
}

.dgc-chat-bg-thumb {
    width: 180px;
    height: 110px;
    border-radius: 12px;
    border: 1px solid var(--dgc-dashboard-border);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.dgc-chat-bg-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   PUBLIC PROFILE
   ======================================== */

.dgc-public-profile {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.dgc-public-profile-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.dgc-public-profile-header::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: clamp(0px, calc(var(--dgc-dashboard-radius-lg) - 4px), 999px);
    border: 1px solid var(--dgc-dashboard-border-subtle);
    pointer-events: none;
}

.dgc-public-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 18px;
    border: 3px solid var(--dgc-dashboard-primary);
    margin-bottom: 20px;
    object-fit: cover;
}

.dgc-public-profile-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.dgc-public-profile-content {
    background: var(--dgc-dashboard-card-bg);
    border: 1px solid var(--dgc-dashboard-border);
    border-radius: var(--dgc-dashboard-radius-lg);
    padding: 30px;
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    position: relative;
    overflow: hidden;
}

.dgc-public-profile-content::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: clamp(0px, calc(var(--dgc-dashboard-radius-lg) - 4px), 999px);
    border: 1px solid var(--dgc-dashboard-border-subtle);
    pointer-events: none;
}

.dgc-public-profile-content.dgc-public-profile-content--shell {
    background: transparent;
    border: 0;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
}

.dgc-public-profile-content.dgc-public-profile-content--shell::after {
    display: none;
}

/* =========================================
   LOADING SPINNER
   ======================================== */

.dgc-loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.dgc-spin {
    animation: dgcSpin 1s linear infinite;
}

@keyframes dgcSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

@media (max-width: 1023px) {
    /* Mobile: full-bleed (true edge-to-edge), regardless of theme container padding. */
    .dgc-dashboard-wrapper {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        overflow-x: hidden;

        /* Let the page scroll normally on mobile unless fullscreen. */
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        overflow-y: visible;
    }

    /* The dashboard header overlaps the chat on small screens. Hide it completely on mobile/tablet. */
    .dgc-dashboard-header {
        display: flex !important;
    }

    .dgc-dashboard-footer {
        display: none;
    }

    /* Show mobile menu toggle */
    .dgc-mobile-menu-toggle {
        display: block;
    }
    
    /* Hide sidebar by default on mobile */
    .dgc-dashboard-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        border-right: 1px solid var(--dgc-dashboard-border);
    }
    
    .dgc-dashboard-sidebar.mobile-open {
        left: 0;
    }
    
    /* Sidebar overlay */
    .dgc-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999;
        display: none;
    }
    
    .dgc-sidebar-overlay.active {
        display: block;
    }
    
    /* Single column layout */
    .dgc-dashboard-grid.has-sidebar {
        grid-template-columns: 1fr;
    }

    .dgc-dashboard-grid {
        height: auto;
        min-height: 0;
    }
    
    /* Right panel becomes bottom tabs - always show on mobile */
    .dgc-dashboard-right-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-left: none !important;
        border-top: 1px solid var(--dgc-dashboard-border) !important;
        z-index: 10050 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-dashboard-right-panel {
        /* Hide the dashboard menu while keyboard is open in chat to give more space */
        display: none !important;
        visibility: hidden !important;
    }
    
    .dgc-dashboard-tabs {
        flex-direction: row !important;
        justify-content: space-around !important;
        padding: 8px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .dgc-tab-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 8px;
        box-sizing: border-box;
    }
    
    .dgc-tab-label {
        display: block;
        font-size: 10px;
        line-height: 1.1;
        opacity: 0.92;
    }
    
    /* Adjust main content for bottom tabs + full-width content */
    .dgc-dashboard-main {
        /* Header is hidden in this breakpoint; main can fill viewport */
        height: auto;
        min-height: 0;
        background: transparent;
    }

    .dgc-dashboard-wrapper--guest .dgc-dashboard-main {
        min-height: 0;
        background: transparent;
    }

    .dgc-dashboard-wrapper--guest,
    .dgc-dashboard-wrapper[data-onboarding-complete="0"] {
        height: var(--dgc-vv-max-height, 100svh);
        min-height: var(--dgc-vv-max-height, 100svh);
    }

    /* No extra bottom padding on mobile (avoid empty space). */
    .dgc-dashboard-main-scroll {
        padding-left: 0;
        padding-right: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Non-chat tabs: ensure content isn't hidden under the fixed bottom tabs. */
    .dgc-dashboard-wrapper:not([data-active-tab="chat"]) .dgc-dashboard-main-scroll {
        padding-bottom: var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px)));
    }

    /* Mobile Chat tab: the chat should fill the available screen area (above bottom tabs). */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        padding: 0 !important;
        overflow: hidden !important;
        /* Override the global mobile scroll padding rule (tabs + 16px). */
        padding-bottom: var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))) !important;
    }

    /* Mobile Chat tab: ensure the composer stays above the fixed bottom tabs.
       The tabs bar uses z-index:10050; in rare fullscreen/viewport transitions it can overlap the input.
       Keeping the composer higher prevents it from appearing “gone”. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"] .dgc-chat-input {
        z-index: 10100 !important;
    }

    /* Force the chat panel itself to be the viewport-sized container.
       This removes any leftover “black background space” caused by chat.css fixed heights/margins. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-tab-content.dgc-tab-chat.active {
        height: calc(var(--dgc-vv-max-height, 100svh) - var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))));
        min-height: 0;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        background: transparent;
        /* Remove rounded corners for fullscreen mode to fill screen completely */
          border-radius: 0;
    }

    /* Ensure chat container in fullscreen mode has proper height */
    .dgc-dashboard-wrapper.is-fullscreen[data-active-tab="chat"] .dgc-dashboard-tab-content.dgc-tab-chat.active {
        /* Even in dashboard fullscreen, the fixed bottom tabs remain visible.
           Keep the chat pane sized above them to prevent overlap/overlay.
           (Keyboard-open and chat mobile fullscreen already override this to use full vv height.) */
        height: calc(var(--dgc-vv-max-height, 100svh) - var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))));
    }

    /* When the keyboard is open on mobile, the dashboard tabs are hidden.
       Fill the full visual viewport so there is no bottom gap above the keyboard.
       JS keeps --dgc-vv-max-height at the correct no-keyboard baseline; fallback to 100svh. */
    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-dashboard-tab-content.dgc-tab-chat.active {
        /* Use the smaller of --dgc-vv-max-height and 100% so that in
           resizes-content mode (layout viewport shrinks for keyboard)
           the tab content doesn't overflow the now-smaller wrapper. */
        height: min(var(--dgc-vv-max-height, 100svh), 100%);
    }

    /* When chat enters mobile fullscreen within the dashboard, tabs are hidden.
       Fill the full visual viewport so the composer can sit flush to the keyboard. */
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen[data-active-tab="chat"] .dgc-dashboard-tab-content.dgc-tab-chat.active {
        height: var(--dgc-vv-max-height, 100svh);
    }

    /* If chat is in mobile-fullscreen while inside the dashboard, it should be true edge-to-edge.
       The dashboard tabs/menus are hidden while fullscreen chat is active, so no bottom offset is needed. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-chat-container.mobile-fullscreen[data-dashboard-mode="1"] {
        --dgc-fullscreen-bottom-offset: 0px;
    }

    /* chat.css adds a small bottom padding in mobile fullscreen to prevent clipping.
       In dashboard mode we instead keep the composer inside the container, so remove it to avoid a visible gap. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-chat-container.mobile-fullscreen[data-dashboard-mode="1"] {
        padding-bottom: 0 !important;
    }

    /* Fullscreen chat inside dashboard: hide bottom dashboard UI so the chat matches standalone fullscreen. */
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen .dgc-dashboard-tabs,
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen .dgc-dashboard-right-panel {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        padding-bottom: 0 !important;
    }

    /* Ensure the latest message never sits under the composer/input in dashboard chat on mobile. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"] .dgc-messages-content {
        /* Reserve space for: input block (~100-110px on mobile incl. pricing line) + bottom tabs (if visible). */
        padding-bottom: max(150px, calc(var(--dgc-dashboard-tabs-total-height, 0px) + 110px));
        scroll-padding-bottom: max(150px, calc(var(--dgc-dashboard-tabs-total-height, 0px) + 110px));
        max-height: none;
    }

    /* When the keyboard is open, the input is pinned above it; reserve extra space so bubbles never sit under it.\n       dashboard.js sets a precise inline value; this is a CSS fallback. */
    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"] .dgc-messages-content {
        padding-bottom: calc(100px + var(--dgc-keyboard-offset, 0px) + 14px) !important;
        scroll-padding-bottom: calc(100px + var(--dgc-keyboard-offset, 0px) + 14px) !important;
    }

    /* Keep the scroll-to-bottom button above the bottom tabs in dashboard mode. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"] .dgc-scroll-to-bottom {
        bottom: calc(var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))) + 20px);
    }

    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"]:not(.mobile-fullscreen):not(.desktop-fullscreen) {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        /* Non-fullscreen: keep rounded corners; fullscreen chat states override this. */
        border-radius: clamp(20px, 5vw, 30px) !important;
        /* IMPORTANT: use background-color only so we don't wipe out the selected background-image/video. */
        background-color: transparent !important;
    }

    /* Mobile fullscreen: wrapper height is determined by top:0; bottom:0 (see rule
       near the top of this file).  height: auto lets it match the layout viewport. */

    .dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-sidebar,
    .dgc-dashboard-wrapper.is-fullscreen .dgc-sidebar-overlay {
        display: none !important;
    }

    /* Show bottom dashboard menu in fullscreen mode (unless keyboard is open) */
    .dgc-dashboard-wrapper.is-fullscreen:not(.dgc-keyboard-open) .dgc-dashboard-right-panel {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10050 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* In fullscreen + keyboard open, keep it visible and lift it above the keyboard. */
    .dgc-dashboard-wrapper.is-fullscreen.dgc-keyboard-open .dgc-dashboard-right-panel {
        display: flex !important;
        position: fixed !important;
        bottom: var(--dgc-keyboard-offset, 0px) !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10050 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Show bottom dashboard tabs in fullscreen mode */
    .dgc-dashboard-wrapper.is-fullscreen:not(.dgc-keyboard-open) .dgc-dashboard-tabs {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Chat mobile fullscreen MUST override dashboard fullscreen chrome.
       This needs to come after the fullscreen "show tabs/menus" rules and be at least as specific,
       otherwise the tabs/menu remain visible and create the bottom gap reported by users. */
    .dgc-dashboard-wrapper.is-fullscreen.dgc-chat-mobile-fullscreen,
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen {
        --dgc-dashboard-tabs-height: 0px;
        --dgc-dashboard-tabs-total-height: 0px;
    }

    .dgc-dashboard-wrapper.is-fullscreen.dgc-chat-mobile-fullscreen .dgc-dashboard-tabs,
    .dgc-dashboard-wrapper.is-fullscreen.dgc-chat-mobile-fullscreen .dgc-dashboard-right-panel,
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen .dgc-dashboard-tabs,
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen .dgc-dashboard-right-panel {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Hide bottom dashboard menu only on Chat tab when keyboard is open (prevents overlay). */
    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-dashboard-right-panel {
        display: none !important;
        visibility: hidden !important;
    }

    .dgc-dashboard-wrapper.is-fullscreen.dgc-keyboard-open[data-active-tab="chat"] .dgc-dashboard-right-panel {
        display: none !important;
        visibility: hidden !important;
    }

    /* In dashboard fullscreen, keep the same rounded chat surface (unless chat itself is fullscreen). */
    .dgc-dashboard-wrapper.is-fullscreen[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"]:not(.mobile-fullscreen):not(.desktop-fullscreen) {
        border-radius: clamp(20px, 5vw, 30px) !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Avoid a visible gap between the bottom tabs and the device UI */
    .dgc-dashboard-right-panel {
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
    }

    /* When keyboard is open on the Chat tab, the bottom tabs are hidden.
       Force padding-bottom:0 so there is no gap above the keyboard. */
    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        padding-bottom: 0 !important;
    }

    /* While typing in chat, prevent the outer dashboard scroller from moving.
       This keeps the chat container background visually fixed; only the composer lifts. */
    .dgc-dashboard-wrapper.dgc-chat-typing .dgc-dashboard-main-scroll {
        overflow: hidden !important;
        overscroll-behavior: none;
        -webkit-overflow-scrolling: auto;
    }

    /* Chat tab: the chat container fills 100% of the tab pane and scrolls
       internally (.dgc-messages-content).  The outer main-scroll must NEVER
       scroll for the chat tab — otherwise the browser’s auto-focus-scroll
       shifts the entire chat background up when the keyboard opens.
       Desktop already has this (min-width:1024 rule); match it on mobile. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-chat-input {
        /* Use position:fixed so the input is viewport-anchored.  This prevents
           the browser from panning the visual viewport ("push-up") to reveal
           the focused element — it’s already in the viewport by definition.
           Safe now that will-change:transform is removed from all ancestors
           and the wrapper is portaled to <body>. */
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(var(--dgc-keyboard-offset, 0px) + env(safe-area-inset-bottom, 0px)) !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        z-index: 10100 !important;
        transform: none !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-top: none !important;
        box-shadow: none !important;
        /* Small bottom padding so the send-row doesn't touch the keyboard edge. */
        padding-bottom: 6px !important;
    }

    /* Mobile dashboard chat (normal view): keep composer visible above the fixed bottom tabs.
       This avoids the input being effectively hidden/cut off in non-fullscreen mode. */
    .dgc-dashboard-wrapper[data-active-tab="chat"]:not(.dgc-keyboard-open):not(.dgc-chat-mobile-fullscreen) .dgc-chat-container[data-dashboard-mode="1"] .dgc-chat-input {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10100;
        transform: none;
    }

    /* In mobile fullscreen inside dashboard, tabs/menus are hidden; do not reserve bottom space. */
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen[data-active-tab="chat"] .dgc-chat-container.mobile-fullscreen[data-dashboard-mode="1"] .dgc-chat-input {
        bottom: 0;
    }

    /* When keyboard opens in mobile fullscreen, attach input to keyboard position */
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen.dgc-keyboard-open[data-active-tab="chat"] .dgc-chat-container.mobile-fullscreen[data-dashboard-mode="1"] .dgc-chat-input {
        /* Same strategy: viewport-fixed, no transform needed. */
        position: fixed !important;
        bottom: calc(var(--dgc-keyboard-offset, 0px) + env(safe-area-inset-bottom, 0px)) !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10100 !important;
        transform: none !important;
    }

    /* In chat mobile fullscreen, bottom tabs/menus are hidden; remove global padding reservation to avoid gaps. */
    .dgc-dashboard-wrapper.dgc-chat-mobile-fullscreen[data-active-tab="chat"] .dgc-dashboard-main-scroll {
        padding-bottom: 0 !important;
    }

    /* Always edge-to-edge on mobile: no padding on the main scroll container to fully overlay screen. */
    .dgc-dashboard-main-scroll {
        padding: 0 !important;
        /* Keep content fully visible above the fixed bottom tabs. */
        padding-bottom: calc(var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))) + 16px) !important;
        /* Ensure scroll container can properly size itself */
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile should be true edge-to-edge inside the dashboard panel (no centering/max-width clamps). */
    .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content,
    .dgc-dashboard-wrapper.is-fullscreen .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    /* Add consistent padding to all non-chat tab content for unified layout */
    .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content:not(.dgc-tab-chat) {
        /* Full-bleed like Chat: keep vertical spacing, remove side gutters. */
        padding: 16px 0 0 0;
        box-sizing: border-box;
    }

    /* Discover: non-scrolling deck that fits exactly between header and bottom tab menu. */
    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-dashboard-main {
        /* Reserve space for the fixed bottom tab bar in the layout flow so
           Discover content can never render underneath it. */
        padding-bottom: var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))) !important;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-dashboard-main-scroll {
        min-height: 0;
        overflow: hidden;
        padding: 0 !important;
        /* The reserved space is handled by .dgc-dashboard-main padding-bottom above. */
        padding-bottom: 0 !important;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-dashboard-main-scroll > .dgc-dashboard-tab-content.dgc-tab-discover.active {
        height: 100%;
        min-height: 0;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner .dgc-hot-or-not {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        margin: 0;
        /* Small insets so the swipe card can be large. */
        padding: 10px;
        box-sizing: border-box;
    }

    /* Discover: make Hot-or-Not cards resize to the container height.
       hot-or-not.css uses max-height:60vh and fixed aspect sizing; in an always-fullscreen
       dashboard this can overflow/cut off. Force the swipe stack to consume the available
       vertical space between the HON header and controls without using viewport units. */
    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner .dgc-hot-or-not {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner .dgc-hot-or-not__header {
        margin-bottom: 8px;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner .dgc-hot-or-not__viewport {
        flex: 1 1 auto;
        min-height: 0;
        /* 1fr for the swipe stack, then controls + helper below. */
        display: grid;
        grid-template-rows: 1fr auto;
        gap: 8px;
        align-items: center;
        justify-items: center;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner .dgc-hon-stack {
        width: auto;
        max-width: 100%;
        /* Fill the available 1fr row; maintain portrait ratio without vh clamps. */
        height: 100%;
        max-height: 100% !important;
        min-height: 0;
        aspect-ratio: 9 / 16;
    }

    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner .dgc-hon-controls {
        width: min(300px, 100%);
    }

    /* Discover: hide status/helper line below the swipe deck to maximize card size. */
    .dgc-dashboard-wrapper[data-active-tab="discover"] .dgc-discover-tab-inner .dgc-hon-helper {
        display: none !important;
    }

    /* Non-chat tab shells should not re-introduce horizontal gutters on mobile. */
    .dgc-profile-tab-inner,
    .dgc-account-tab-inner {
        border-radius: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Remove empty space from grid, carousel, and browse tabs on mobile */
    .dgc-dashboard-wrapper[data-active-tab="grid"] .dgc-dashboard-main-scroll,
    .dgc-dashboard-wrapper[data-active-tab="carousel"] .dgc-dashboard-main-scroll,
    .dgc-dashboard-wrapper[data-active-tab="browse"] .dgc-dashboard-main-scroll {
        padding: 0 !important;
        padding-bottom: var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))) !important;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .dgc-dashboard-wrapper[data-active-tab="grid"] .dgc-discover-tab-inner,
    .dgc-dashboard-wrapper[data-active-tab="carousel"] .dgc-discover-tab-inner,
    .dgc-dashboard-wrapper[data-active-tab="browse"] .dgc-browse-tab-inner {
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        box-sizing: border-box;
    }

    .dgc-dashboard-wrapper[data-active-tab="grid"] .dgc-hot-or-not,
    .dgc-dashboard-wrapper[data-active-tab="carousel"] .dgc-hot-or-not,
    .dgc-dashboard-wrapper[data-active-tab="browse"] .dgc-hot-grid {
        /* Keep the same comfortable padding/proportions as the dedicated Hot-or-Not page. */
        /* Full-bleed width like other dashboard tabs (no side gutters). */
        /* Add extra bottom padding to prevent cutoff by dashboard tabs */
        padding: 24px 16px calc(var(--dgc-dashboard-tabs-total-height, 90px) + 16px) !important;
        margin: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        /* Restore rounded corners on mobile (avoid edge-to-edge square cards). */
        border-radius: var(--dgc-dashboard-radius-lg) !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        min-height: calc(100vh - var(--dgc-dashboard-tabs-total-height, 90px)) !important;
    }

    /* Grid portrait cards: keep rounded corners inside dashboard on mobile. */
    .dgc-dashboard-wrapper .dgc-hon-grid-link {
        border-radius: 22px !important;
    }

    /* Mobile: keep vertical spacing, but remove side padding for full-width content. */
    .dgc-dashboard-wrapper[data-active-tab="profile"] .dgc-dashboard-main-scroll,
    .dgc-dashboard-wrapper[data-active-tab="favorites"] .dgc-dashboard-main-scroll {
        padding-top: clamp(8px, 2vw, 12px);
        /* Use consistent bottom padding with dashboard tabs height */
        padding-bottom: calc(var(--dgc-dashboard-tabs-total-height, 90px) + 16px) !important;
    }

    /* Common tab contents sometimes use auto-margins; keep them full-width on mobile. */
    .dgc-tab-chat .dgc-chat-container,
    .dgc-chatbot-profile-drawer {
        margin-left: 0;
        margin-right: 0;
    }

    /* Header is hidden: don't subtract 80px from grid height */
    .dgc-dashboard-grid {
        min-height: 0;
    }
    
    /* Recent chats in sidebar - wider layout */
    .dgc-recent-chat-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px;
    }
    
    .dgc-recent-chat-name {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 640px) {
    /* Full-width, edge-to-edge Hot-or-Not in the dashboard on small screens */
    .dgc-dashboard-wrapper .dgc-hot-or-not {
        border-left: 0;
        border-right: 0;
        border-radius: var(--dgc-dashboard-radius-lg);
        padding: 14px;
    }
}

@media (max-width: 640px) {
    .dgc-dashboard-header {
        padding: 15px;
    }
    
    .dgc-dashboard-username {
        font-size: 14px;
    }
    
    .dgc-dashboard-user-email {
        display: none;
    }
    
    .dgc-dashboard-balance {
        padding: 6px 12px;
    }
    
    .dgc-dashboard-balance-label {
        display: none;
    }
    
    .dgc-dashboard-main {
        padding: 0;
    }
    
    .dgc-transactions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .dgc-transaction-filter {
        width: 100%;
    }
}

/* =========================================
   RECENT CHATS STANDALONE SHORTCODE
   ======================================== */

.dgc-recent-chats-standalone {
    padding: 20px;
}

.dgc-recent-chats-standalone.vertical .dgc-recent-chat-item {
    flex-direction: column;
    align-items: center;
}

.dgc-recent-chats-standalone.horizontal {
    display: flex;
    gap: 15px;
    overflow-x: auto;
}

.dgc-recent-chats-standalone.horizontal .dgc-recent-chat-item {
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

/* =========================================
   ACCOUNT TAB — PROFILE COMPLETION BONUSES
   ======================================== */

.dgc-bonus-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--dgc-dashboard-text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

.dgc-bonus-badge.is-ready {
    background: rgba(102, 227, 255, 0.10);
    border-color: rgba(102, 227, 255, 0.22);
}

.dgc-bonus-badge.is-claimed {
    opacity: 0.72;
}

