/* 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;
}

/* =========================================
   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;
}

/* 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) {
    body.dgc-dashboard-fullscreen {
        overflow: hidden;
    }
}

@media (max-width: 1023px) {
    .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));
    }

    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] {
        /* Keep bottom tabs visible even with the keyboard open.
           The chat input is positioned above tabs + keyboard in the mobile rules below. */
        --dgc-dashboard-tabs-height: 72px;
        --dgc-dashboard-tabs-total-height: calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 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: flex !important;
    }
    body.dgc-dashboard-fullscreen {
        overflow: hidden;
        position: fixed;
        width: 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: 100vh !important;
        height: 100svh !important;
        max-height: 100vh !important;
        max-height: 100svh !important;
        min-height: 100vh !important;
        min-height: 100svh !important;
        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 */
    body.admin-bar .dgc-dashboard-wrapper.is-fullscreen {
        top: 32px;
        height: calc(100vh - 32px) !important;
        height: calc(100svh - 32px) !important;
        max-height: calc(100vh - 32px) !important;
        max-height: calc(100svh - 32px) !important;
    }

    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;
            height: calc(100vh - 46px) !important;
            height: calc(100svh - 46px) !important;
            max-height: calc(100vh - 46px) !important;
            max-height: calc(100svh - 46px) !important;
        }

        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;
}

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

/* 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 (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-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-header-bg, rgba(9, 11, 18, 0.25));
    border-top: 1px solid var(--dgc-dashboard-border-subtle);
    backdrop-filter: blur(var(--dgc-dashboard-blur));
    -webkit-backdrop-filter: blur(var(--dgc-dashboard-blur));
    color: 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;
}

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

.dgc-onboarding-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 36px);
    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: 2500;
}

.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(480px, 100%);
    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: hidden;
    animation: dgcOnbPop 220ms ease;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

@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));
}

.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-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: auto;
}

/* 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: 18px 16px 12px;
    }
    .dgc-onboarding-body {
        padding: 14px 16px 10px;
    }
}

.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;
}

.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-dashboard-primary);
    color: white;
    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"] {
        width: 100%;
        max-width: 100%;
        margin: 0;
        height: calc(100vh - 90px - env(safe-area-inset-bottom, 0px));
        height: calc(100svh - 90px - env(safe-area-inset-bottom, 0px));
        border: 0;
        box-shadow: none;
        /* Square corners on mobile for clean edge-to-edge display */
        border-radius: 0 !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 .dgc-chatbot-profile-drawer {
    display: none !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%;
}

.dgc-discover-tab-inner .dgc-hot-or-not,
.dgc-browse-tab-inner .dgc-hot-grid {
    margin: 0;
    max-width: none;
    width: 100%;
}

/* 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%;
}

.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-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-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 {
    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);
}

@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;
}

.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.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);
}

/* =========================================
   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: none !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"] {
        min-height: 0;
    }

    /* 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;
    }

    /* 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;
        overflow: hidden;
        padding-bottom: var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px)));
    }

    /* 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(100vh - var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px))));
        height: calc(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 {
        height: 100vh;
        height: 100svh;
    }

    /* If chat is in mobile-fullscreen while inside the dashboard, lift it above the fixed bottom tabs. */
    .dgc-dashboard-wrapper[data-active-tab="chat"] .dgc-chat-container.mobile-fullscreen[data-dashboard-mode="1"] {
        --dgc-fullscreen-bottom-offset: var(--dgc-dashboard-tabs-total-height, calc(var(--dgc-dashboard-tabs-height, 72px) + env(safe-area-inset-bottom, 0px)));
    }

    /* 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 (~170-190px on mobile incl. pricing line) + bottom tabs (if visible). */
        padding-bottom: max(220px, calc(var(--dgc-dashboard-tabs-total-height, 0px) + 180px));
        scroll-padding-bottom: max(220px, calc(var(--dgc-dashboard-tabs-total-height, 0px) + 180px));
        max-height: none;
    }

    /* When the keyboard is open, the input is pinned above it; reserve extra space so bubbles never sit under it. */
    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"] .dgc-messages-content {
        padding-bottom: calc(max(220px, calc(var(--dgc-dashboard-tabs-total-height, 0px) + 180px)) + var(--dgc-keyboard-offset, 0px));
        scroll-padding-bottom: calc(max(220px, calc(var(--dgc-dashboard-tabs-total-height, 0px) + 180px)) + var(--dgc-keyboard-offset, 0px));
    }

    /* 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"] {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        /* Remove rounded corners for fullscreen mode to fill screen completely */
        border-radius: 0 !important;
        /* IMPORTANT: use background-color only so we don't wipe out the selected background-image/video. */
        background-color: transparent !important;
    }

    /* Mobile fullscreen: show ONLY chat + bottom dashboard tabs. */
    .dgc-dashboard-wrapper.is-fullscreen {
        height: 100vh;
        height: 100svh;
    }

    .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;
    }

    /* 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 fullscreen mobile, eliminate the “black box” by making chat truly edge-to-edge. */
    .dgc-dashboard-wrapper.is-fullscreen[data-active-tab="chat"] .dgc-chat-container[data-dashboard-mode="1"] {
        border-radius: 22px !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, reserve space for the bottom tabs + keyboard so input isn't covered */
    .dgc-dashboard-wrapper.dgc-keyboard-open .dgc-dashboard-main-scroll {
        padding-bottom: 0;
    }

    .dgc-dashboard-wrapper.dgc-keyboard-open[data-active-tab="chat"] .dgc-chat-input {
        position: fixed;
        left: 0;
        right: 0;
        /* Tabs are hidden when keyboard is open, so input only needs to be above keyboard */
        bottom: var(--dgc-keyboard-offset, 0px);
        z-index: 9999;
    }

    /* Always edge-to-edge on mobile: no padding on the main scroll container to fully overlay screen. */
    .dgc-dashboard-main-scroll {
        padding: 0 !important;
    }

    /* 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;
    }

    /* 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;
    }

    .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: 16px;
        width: 100%;
        max-width: 100%;
    }

    .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. */
        padding: 24px 18px 36px !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;
    }

    /* 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);
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }

    /* 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;
}

