/* Shared presentation for every authenticated owner Mini App route. */
.neon-workspace-shell {
    /* chat.css has a legacy :root 0px value. Owner screens always reserve
       room for the fixed bottom navigation on phone and landscape screens. */
    --bottom-nav-height: 86px;
    --workspace-panel: linear-gradient(132deg, rgba(9, 71, 111, 0.82), rgba(14, 34, 82, 0.88));
    --workspace-panel-soft: linear-gradient(140deg, rgba(24, 93, 132, 0.42), rgba(22, 43, 91, 0.52));
    --workspace-border: rgba(89, 190, 244, 0.34);
    --workspace-border-strong: rgba(74, 222, 255, 0.58);
    --workspace-shadow: 0 18px 44px rgba(0, 13, 38, 0.28), inset 0 1px 0 rgba(205, 243, 255, 0.11);
    --workspace-muted: #a1bed6;
    --color-surface-glass-card: rgba(20, 71, 111, 0.48);
    --color-surface-glass-card-hover: rgba(28, 91, 136, 0.58);
    --color-border-glass-card: var(--workspace-border);
    --color-surface-glass-panel: rgba(19, 65, 105, 0.56);
    --color-border-glass-panel: rgba(100, 194, 241, 0.28);
    --color-surface-glass-button: rgba(31, 96, 139, 0.44);
    --color-surface-glass-button-hover: rgba(38, 122, 169, 0.56);
    --color-surface-glass-nav: rgba(7, 58, 94, 0.92);
    --crm-accent: #32c8ff;
    --crm-accent-strong: #168cff;
    --crm-cyan: #48e7ff;
    --crm-surface: rgba(10, 54, 91, 0.68);
    --crm-surface-strong: rgba(13, 70, 111, 0.82);
    --crm-border: var(--workspace-border);
    --crm-border-strong: var(--workspace-border-strong);
    --crm-shadow: var(--workspace-shadow);
    color-scheme: dark;
}

#content.neon-workspace-content {
    color: #edf8ff;
    overflow-x: hidden;
}

.neon-workspace-content :is(#route-host, #overlay-host) {
    width: 100%;
    min-width: 0;
}

.neon-workspace-content :is(.route-view, .profile-view-shell, .requests-view-shell) {
    width: min(100%, var(--saas-width, 1060px));
    min-width: 0;
    margin-inline: auto;
}

.neon-workspace-content :where(.glass-card) {
    border-color: var(--workspace-border);
    background: var(--workspace-panel);
    box-shadow: var(--workspace-shadow);
    /* Static gradients provide the glass appearance without a blur per card. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.neon-workspace-content :where(.btn-primary, .btn--primary, .button-primary) {
    min-height: 44px;
    border: 1px solid rgba(96, 208, 255, 0.68);
    color: #fff;
    background: linear-gradient(112deg, #176cf5, #05aaca);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 22px rgba(3, 132, 255, 0.22);
}

.neon-workspace-content :where(.btn-secondary, .btn--secondary, .button-secondary, .btn--ghost) {
    min-height: 44px;
    border: 1px solid var(--workspace-border);
    color: #dff5ff;
    background: rgba(38, 87, 132, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.neon-workspace-content :where(.btn--danger) {
    min-height: 44px;
    border-color: rgba(251, 113, 133, 0.5);
    color: #ffdce3;
    background: rgba(128, 34, 65, 0.34);
}

.neon-workspace-content :where(input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea, .form-input, .input-field) {
    min-height: 44px;
    max-width: 100%;
    border: 1px solid rgba(90, 174, 226, 0.42);
    border-radius: 14px;
    color: #edf8ff;
    background: rgba(11, 43, 80, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.neon-workspace-content :where(input, select, textarea)::placeholder { color: rgba(178, 211, 233, 0.58); }
.neon-workspace-content :where(h1, h2, h3, h4, strong) { color: #f3fbff; }
.neon-workspace-content :where(.text-hint, .text-secondary) { color: var(--workspace-muted); }

.neon-workspace-content :where(.billing, .providers, .catalog, .orders, .leads, .conversations, .campaigns, .watchlists, .handoffs, .quotes, .skills-workspace, .requests-screen) {
    width: min(100%, 1080px);
    min-width: 0;
    margin-inline: auto;
}

.neon-workspace-content :where(.billing__plan-card, .providers__item, .catalog__card, .conversations__item, .campaigns__item, .campaigns__form) {
    border: 1px solid var(--workspace-border);
    border-radius: 20px;
    color: #edf8ff;
    background: var(--workspace-panel-soft);
    box-shadow: var(--workspace-shadow);
}

.neon-workspace-content :where(table) {
    border-collapse: separate;
    border-spacing: 0;
    color: #e8f7ff;
}

.neon-workspace-content :where(th) { color: #9fcbe5; }
.neon-workspace-content :where(th, td) { border-color: rgba(107, 180, 222, 0.2); }

@media (hover: hover) {
    .neon-workspace-content :where(.btn-primary, .btn--primary, .button-primary, .btn-secondary, .btn--secondary, .button-secondary):hover {
        border-color: rgba(112, 224, 255, 0.82);
        transform: translateY(-1px);
    }
}

@media (max-width: 767px) {
    #content.neon-workspace-content {
        padding: calc(14px + max(var(--app-top-chrome-padding), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)))) 12px calc(var(--bottom-nav-height, 86px) + 20px);
    }

    .neon-workspace-content :where(.billing, .upgrade) { padding-inline: 0; }
    .neon-workspace-content :where(.billing__transactions, .orders__table, .leads__table, .watchlists__table, .handoffs__table, .quotes__table) {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .neon-workspace-content :where(.glass-card, .billing__plan-card, .providers__item) {
        background: #0d355f;
    }
}


/* Cross-route containment: legacy screens must not widen the Telegram viewport. */
.neon-workspace-content,
.neon-workspace-content *,
.neon-workspace-content *::before,
.neon-workspace-content *::after { box-sizing: border-box; }

.neon-workspace-content :where(.route-view, .profile-view-shell, .requests-view-shell, section, article, form, fieldset, .glass-card) {
    min-width: 0;
    max-width: 100%;
}

.neon-workspace-content :where(.row, .actions, .toolbar, .header-actions, .button-row) {
    min-width: 0;
    flex-wrap: wrap;
}

.neon-workspace-content :where(img, svg, canvas, video, iframe) { max-width: 100%; }
.neon-workspace-content :where(p, a, span, td, th, code) { overflow-wrap: anywhere; }
.neon-workspace-content :where(button, [role='button']) { max-width: 100%; }
.neon-workspace-content :where(dialog, .modal-content) {
    width: min(calc(100vw - 24px), 720px);
    max-width: calc(100vw - 24px);
    max-height: calc(var(--app-visible-viewport-height, 100dvh) - 24px);
    overflow: auto;
}

/* Profile and wallet retain their handlers; only presentation becomes responsive. */
.neon-route--profile .profile-view-shell { display: grid; gap: 16px; }
.neon-route--profile .profile-view-shell > .glass-card { margin-top: 0 !important; }
.neon-route--profile .progress-bar-container { overflow: hidden; }

@media (max-width: 479px) {
    .neon-route--profile .glass-card div[style*='grid-template-columns: 1fr 1fr'] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (min-width: 768px) {
    #content.neon-workspace-content {
        padding: calc(20px + var(--app-top-chrome-padding, 0px)) clamp(20px, 4vw, 48px) 32px;
    }

    .neon-workspace-content :is(.route-view, .profile-view-shell, .requests-view-shell) {
        width: min(100%, 1180px);
    }

    .neon-route--profile .profile-view-shell {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .neon-route--profile .profile-view-shell > :first-child { grid-column: 1 / -1; }
}

@media (orientation: landscape) and (max-height: 600px) {
    #content.neon-workspace-content {
        padding-top: max(10px, var(--app-top-chrome-padding, 0px));
    }

    .app-container.neon-workspace-shell .bottom-nav {
        padding-top: 4px;
        padding-bottom: calc(4px + var(--safe-area-bottom, 0px));
    }
}

