/* Interaction and paint budget for the owner theme. Keep feature geometry,
 * semantic states and hidden attributes authoritative. No runtime observers. */

#content.neon-workspace-content {
    scroll-padding-block: 16px calc(var(--bottom-nav-height, 86px) + 20px);
}

/* A route fade must not swallow taps or make a fixed dialog relative to a
 * transformed/filtered route host. Content swaps are already synchronous. */
#content.neon-workspace-content.is-transitioning { pointer-events: auto; }
#content.neon-workspace-content.is-transitioning > * {
    animation: none;
    will-change: auto;
}

/* Avoid one expensive backdrop/compositor surface for every repeated card. */
.neon-workspace-content :is(.glass-card, .neon-glass),
.neon-workspace-content :is(.glass-card, .neon-glass):hover {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
}
.neon-workspace-content .neon-glass::after,
.neon-workspace-content .ambient-glow::before,
.neon-workspace-content .ambient-glow::after {
    animation: none;
    pointer-events: none;
}

/* Renderers use both table-class and wrapper-class markup. A native table
 * needs a block scroll box too, including on narrow desktop/landscape routes. */
.neon-workspace-content table:is(.billing__transactions, .orders__table,
    .orders__tx-table, .leads__table, .watchlists__table, .handoffs__table,
    .quotes__table, .bookings__table) {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

/* These dialogs are rendered inside #content. Lift the containing stacking
 * context only while its active route has an open modal, never a cached route. */
#content.neon-route--bookings:has(.owner-booking-panel-layer, .owner-contact-panel-layer),
#content.neon-route--mybots:has(.mybots-modal:not([hidden])) { z-index: 1100; }

.neon-workspace-content :is(.owner-booking-panel, .owner-contact-panel) {
    display: flex;
    flex-direction: column;
    max-height: min(90dvh, calc(var(--app-visible-viewport-height, 100dvh) - 12px), 860px);
}
.neon-workspace-content :is(.owner-booking-panel__header, .owner-contact-panel__header) {
    flex: 0 0 auto;
}
.neon-workspace-content :is(.owner-booking-panel__content, .owner-contact-panel__content) {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}
.neon-workspace-content .mybots-modal[hidden] { display: none; }

/* Keep navigation on the same centered surface as the app (including PCs
 * wider than 1200px); do not reduce gesture-area padding in landscape. */
.app-container.neon-workspace-shell .bottom-nav {
    max-width: 480px;
    margin-inline: auto;
}
@media (min-width: 768px) {
    .app-container.neon-workspace-shell .bottom-nav {
        left: max(0px, calc((100vw - var(--layout-max-width, 1200px)) / 2));
        margin-inline: 0;
    }
    #content.neon-workspace-content { scroll-padding-bottom: 32px; }
}

/* Reduce blur layers on touch devices; keep opaque enough fallbacks readable. */
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
    .app-container.neon-workspace-shell { --blur-card: 0px; --blur-panel: 0px; --blur-button: 0px; --blur-sm: 0px; }
    .neon-workspace-content :is(.btn-primary, .btn-secondary, .glass-button),
    .app-container.neon-workspace-shell .bottom-nav,
    .app-container.neon-workspace-shell .nav-item {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
