/* ============================================================
   Zypexa Mobile Communications + App-Readiness Layer
   Stage 1 Pass 1: dedicated CSS layer anchor
   Stage 1 Pass 2: shell spacing variables
   Stage 1 Pass 3: viewport and safe-area stabilization variables
   Stage 1 Pass 4: no-horizontal-overflow guard
   Stage 1 Pass 5: shell validation closure
   Stage 2 Pass 2: mobile softphone compact layout
   Stage 2 Pass 3: mobile softphone interaction polish
   Stage 2 Pass 4: mobile call focus and action priority
   Stage 2 Pass 5: mobile softphone core closure
   Stage 2 Pass 6: mobile softphone core QA cleanup
   Stage 3 Pass 1: browser reliability foundation
   Stage 3 Pass 2: browser resync hardening
   Stage 3 Pass 3: media readiness hardening
   Stage 3 Pass 4: connection recovery hardening
   Stage 3 Pass 5: browser diagnostics QA closure
   Stage 4 Pass 1: communications workflow contract
   Stage 4 Pass 2: contact communication actions
   Stage 4 Pass 3: SMS inbox and conversation mobile upgrade
   Stage 4 Pass 4: call log follow-up mobile upgrade
   Stage 4 Pass 5: visible diagnostics and recovery UI
   Stage 4 Pass 6: active call workspace mobile polish
   Stage 4 Pass 7: power dialer mobile run mode
   Stage 4 Pass 8: mobile workflow QA closure

   This file is loaded after the existing global and SaaS UI styles so
   mobile communications passes can make scoped, predictable changes
   without adding more rules to styles.css.
   ============================================================ */

:root {
    --zxp-mobile-communications-layer: stage1-pass1;
    --zxp-mobile-shell-spacing-layer: stage1-pass2;
    --zxp-mobile-viewport-stabilization-layer: stage1-pass3;
    --zxp-mobile-overflow-guard-layer: stage1-pass4;
    --zxp-mobile-shell-validation-layer: stage1-pass5;
    --zxp-mobile-softphone-layout-layer: stage2-pass2;
    --zxp-mobile-softphone-interaction-layer: stage2-pass3;
    --zxp-mobile-softphone-call-focus-layer: stage2-pass4;
    --zxp-mobile-softphone-accessibility-layer: stage2-pass5;
    --zxp-mobile-softphone-core-qa-layer: stage2-pass6;
    --zxp-mobile-softphone-browser-reliability-layer: stage3-pass1;
    --zxp-mobile-softphone-browser-resync-layer: stage3-pass2;
    --zxp-mobile-softphone-media-readiness-layer: stage3-pass3;
    --zxp-mobile-softphone-connection-recovery-layer: stage3-pass4;
    --zxp-mobile-softphone-stage3-qa-layer: stage3-pass5;
    --zxp-mobile-communications-workflow-contract-layer: stage4-pass1;
    --zxp-mobile-contact-actions-layer: stage4-pass2;
    --zxp-mobile-sms-workflow-layer: stage4-pass3;
    --zxp-mobile-call-log-workflow-layer: stage4-pass4;
    --zxp-mobile-diagnostics-ui-layer: stage4-pass5;
    --zxp-mobile-active-call-workspace-layer: stage4-pass6;
    --zxp-mobile-power-dialer-workflow-layer: stage4-pass7;
    --zxp-mobile-stage4-release-qa-layer: stage4-pass8;
    --zxp-mobile-power-dialer-gap: 0.72rem;
    --zxp-mobile-power-dialer-card-radius: 18px;
    --zxp-mobile-power-dialer-sticky-top: calc(var(--zxp-mobile-safe-top, 0px) + 0.5rem);
    --zxp-mobile-power-dialer-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 108px);
    --zxp-mobile-power-dialer-history-max-height: min(320px, calc(var(--zxp-mobile-layout-viewport-height, 100dvh) * 0.45));
    --zxp-mobile-active-call-workspace-gap: 0.62rem;
    --zxp-mobile-active-call-workspace-radius: 18px;
    --zxp-mobile-active-call-workspace-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 96px);
    --zxp-mobile-active-call-workspace-panel-max-height: min(460px, calc(var(--zxp-mobile-layout-viewport-height, 100dvh) * 0.62));
    --zxp-mobile-diagnostics-ui-gap: 0.55rem;
    --zxp-mobile-diagnostics-ui-radius: 16px;
    --zxp-mobile-diagnostics-ui-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 72px);
    --zxp-mobile-call-log-card-gap: 0.72rem;
    --zxp-mobile-call-log-media-max-height: min(280px, calc(var(--zxp-mobile-layout-viewport-height, 100dvh) * 0.42));
    --zxp-mobile-sms-card-gap: 0.7rem;
    --zxp-mobile-sms-composer-sticky-bottom: calc(var(--zxp-mobile-softphone-height, 86px) + var(--zxp-mobile-safe-bottom, 0px) + 0.75rem);
    --zxp-mobile-sms-thread-max-height: calc(var(--zxp-mobile-layout-viewport-height, 100dvh) - var(--zxp-mobile-safe-top, 0px) - var(--zxp-mobile-safe-bottom, 0px) - 240px);
    --zxp-mobile-contact-actions-sticky-top: calc(var(--zxp-mobile-safe-top, 0px) + 0.5rem);
    --zxp-mobile-contact-actions-gap: 0.55rem;
    --zxp-mobile-contact-actions-min-height: 48px;
    --zxp-mobile-communications-workflow-touch-target: 46px;
    --zxp-mobile-communications-workflow-gap: 10px;
    --zxp-mobile-communications-workflow-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 56px);
    --zxp-mobile-softphone-stage3-qa-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 48px);
    --zxp-mobile-softphone-stage3-qa-settle-duration: 0.001ms;
    --zxp-mobile-softphone-connection-recovery-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 40px);
    --zxp-mobile-softphone-connection-recovery-settle-duration: 0.001ms;
    --zxp-mobile-softphone-media-readiness-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 32px);
    --zxp-mobile-softphone-resync-settle-duration: 0.001ms;
    --zxp-mobile-softphone-resync-scroll-padding: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 24px);
    --zxp-mobile-softphone-browser-edge-gap: max(var(--zxp-mobile-softphone-edge-gap, 10px), var(--zxp-mobile-safe-left, 0px));
    --zxp-mobile-softphone-browser-viewport-fallback: var(--zxp-mobile-layout-viewport-height, 100dvh);
    --zxp-mobile-softphone-priority-action-height: 54px;
    --zxp-mobile-softphone-focus-ring-space: 3px;
    --zxp-mobile-softphone-focus-outline-width: 3px;
    --zxp-mobile-softphone-action-gap: 8px;
    --zxp-mobile-softphone-action-radius: 14px;
    --zxp-mobile-softphone-press-scale: 0.985;
    --zxp-mobile-softphone-edge-gap: 10px;
    --zxp-mobile-softphone-radius: 24px;
    --zxp-mobile-softphone-peek-height: 76px;
    --zxp-mobile-softphone-active-height: 172px;
    --zxp-mobile-softphone-keyboard-height: 86px;
    --zxp-mobile-softphone-expanded-max-height: min(620px, 78dvh);
    --zxp-mobile-safe-top: env(safe-area-inset-top, 0px);
    --zxp-mobile-safe-right: env(safe-area-inset-right, 0px);
    --zxp-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --zxp-mobile-safe-left: env(safe-area-inset-left, 0px);
    --zxp-mobile-touch-target-min: var(--zxp-mobile-touch-target, 44px);
    --zxp-mobile-viewport-width: var(--zxp-visual-viewport-width, 100vw);
    --zxp-mobile-viewport-height: var(--zxp-visual-viewport-height, 100dvh);
    --zxp-mobile-layout-viewport-height: var(--zxp-layout-viewport-height, 100dvh);
    --zxp-mobile-viewport-offset-top: var(--zxp-visual-viewport-offset-top, 0px);
    --zxp-mobile-viewport-offset-left: var(--zxp-visual-viewport-offset-left, 0px);
    --zxp-mobile-keyboard-inset: var(--zxp-visual-keyboard-inset, 0px);
    --zxp-mobile-content-max-width: 100%;
    --zxp-mobile-min-inline-size: 0px;
    --zxp-mobile-topbar-height: 0px;
    --zxp-mobile-bottom-nav-height: 0px;
    --zxp-mobile-softphone-height: 0px;
    --zxp-mobile-composer-height: 0px;
    --zxp-mobile-shell-gutter-x: 0px;
    --zxp-mobile-shell-gutter-y: 0px;
    --zxp-mobile-content-bottom-offset: calc(
        var(--zxp-mobile-safe-bottom, 0px)
        + var(--zxp-mobile-bottom-nav-height, 0px)
        + var(--zxp-mobile-softphone-height, 0px)
        + var(--zxp-mobile-composer-height, 0px)
    );
}

body[data-zxp-app-surface="workspace"] .zxp-app-shell,
body[data-zxp-app-surface="workspace"] .main-shell,
body[data-zxp-app-surface="workspace"] .content-wrap {
    --zxp-mobile-shell-bottom-offset: var(--zxp-mobile-content-bottom-offset);
}

body[data-zxp-app-surface="workspace"] {
    --zxp-mobile-current-viewport-height: var(--zxp-mobile-viewport-height);
    --zxp-mobile-current-keyboard-inset: var(--zxp-mobile-keyboard-inset);
}

@media (max-width: 980px) {
    body[data-zxp-app-surface="workspace"] {
        --zxp-mobile-shell-gutter-x: clamp(12px, 4vw, 18px);
        --zxp-mobile-shell-gutter-y: 14px;
        --zxp-mobile-topbar-height: calc(64px + var(--zxp-mobile-safe-top, 0px));
        --zxp-mobile-workspace-min-height: var(--zxp-visual-viewport-height, 100dvh);
    }
}

@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"] {
        --zxp-mobile-communications-enabled: 1;
        --zxp-mobile-shell-gutter-x: calc(14px + var(--zxp-mobile-safe-left, 0px));
        --zxp-mobile-shell-gutter-y: 12px;
        --zxp-mobile-topbar-height: calc(58px + var(--zxp-mobile-safe-top, 0px));
        --zxp-mobile-bottom-nav-height: 0px;
        --zxp-mobile-softphone-height: 0px;
        --zxp-mobile-composer-height: 0px;
    }
}

@media (max-width: 980px) {
    html[data-zxp-viewport-size="mobile"],
    html[data-zxp-viewport-size="tablet"],
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .zxp-app-shell,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .app-shell,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .main-shell,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .content-wrap,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser main,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser section,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser article,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .card,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .panel,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .dashboard-card,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .workspace-card,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .page-shell,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .page-header,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .section-header,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .form,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .field,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .grid,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .grid-2,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .grid-3,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .grid-4 {
        max-width: var(--zxp-mobile-content-max-width, 100%);
        min-width: var(--zxp-mobile-min-inline-size, 0px);
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-browser img,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser svg,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser canvas,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser video,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser iframe {
        max-width: 100%;
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-browser p,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser li,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser a,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser label,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .muted,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .helper-text,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .empty-state,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .status-pill,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .table-actions,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .nav-label-text {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-browser input,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser select,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser textarea,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser button,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .button {
        max-width: 100%;
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-browser pre,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser code {
        max-width: 100%;
        overflow-wrap: anywhere;
        white-space: pre-wrap;
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-browser pre,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .table-responsive,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .table-scroll,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .data-table-wrap,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .zxp-mobile-horizontal-scroll,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser [data-zxp-horizontal-scroll],
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser [style*="overflow-x:auto"],
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser [style*="overflow-x: auto"] {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .table-responsive table,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .table-scroll table,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .data-table-wrap table,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser .zxp-mobile-horizontal-scroll table,
    body[data-zxp-app-surface="workspace"].zxp-mobile-browser [data-zxp-horizontal-scroll] table {
        min-width: max-content;
    }
}

@supports not (overflow: clip) {
    @media (max-width: 980px) {
        html[data-zxp-viewport-size="mobile"],
        html[data-zxp-viewport-size="tablet"],
        body[data-zxp-app-surface="workspace"].zxp-mobile-browser {
            overflow-x: hidden;
        }
    }
}

/* Stage 2 Pass 2: mobile softphone compact layout. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport {
        --zxp-mobile-softphone-height: var(--zxp-mobile-softphone-peek-height, 76px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport.zxp-softphone-mobile-call-active {
        --zxp-mobile-softphone-height: var(--zxp-mobile-softphone-active-height, 172px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport.zxp-softphone-mobile-keyboard-open {
        --zxp-mobile-softphone-height: var(--zxp-mobile-softphone-keyboard-height, 86px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport .zxp-app-shell,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport .main-shell,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport .content-wrap {
        scroll-padding-bottom: calc(var(--zxp-mobile-shell-bottom-offset, 0px) + 18px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] {
        left: calc(var(--zxp-mobile-safe-left, 0px) + var(--zxp-mobile-softphone-edge-gap, 10px));
        right: auto;
        bottom: calc(var(--zxp-mobile-safe-bottom, 0px) + var(--zxp-mobile-softphone-edge-gap, 10px));
        width: calc(100vw - var(--zxp-mobile-safe-left, 0px) - var(--zxp-mobile-safe-right, 0px) - var(--zxp-mobile-softphone-edge-gap, 10px) - var(--zxp-mobile-softphone-edge-gap, 10px));
        max-width: none;
        max-height: calc(var(--zxp-softphone-mobile-viewport-height, var(--zxp-mobile-viewport-height, 100dvh)) - var(--zxp-mobile-safe-top, 0px) - var(--zxp-mobile-safe-bottom, 0px) - var(--zxp-mobile-softphone-edge-gap, 10px) - var(--zxp-mobile-softphone-edge-gap, 10px));
        border-radius: var(--zxp-mobile-softphone-radius, 24px);
        overflow: hidden;
        overscroll-behavior: contain;
        touch-action: manipulation;
        transform: translateZ(0);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] .softphone-header {
        min-height: 58px;
        padding: 10px 12px;
        gap: 10px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] .softphone-header-title,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] .softphone-header-copy,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] [data-softphone-compact-call] > div {
        min-width: 0;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] .softphone-header-copy strong,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] [data-softphone-status],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] [data-softphone-compact-label],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] [data-softphone-compact-number] {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-body] {
        max-height: calc(var(--zxp-softphone-mobile-viewport-height, var(--zxp-mobile-viewport-height, 100dvh)) - var(--zxp-mobile-safe-top, 0px) - var(--zxp-mobile-safe-bottom, 0px) - 92px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 10px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-collapsed="true"] [data-softphone-body] {
        display: none;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-collapsed="true"] [data-softphone-compact-controls]:not([hidden]) {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 8px 10px 10px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-collapsed="true"] [data-softphone-compact-controls] button {
        min-height: var(--zxp-mobile-touch-target-min, 44px);
        border-radius: 12px;
        white-space: nowrap;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-active]:not([hidden]),
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-incoming]:not([hidden]),
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-disposition-panel]:not([hidden]) {
        gap: 10px;
        padding: 12px;
        border-radius: 18px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-active] .softphone-active-heading {
        gap: 10px;
        align-items: flex-start;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-active] .softphone-primary-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-active] .softphone-primary-controls .button,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-incoming] .button,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-disposition-panel] .button {
        min-height: var(--zxp-mobile-touch-target-min, 44px);
        justify-content: center;
        white-space: normal;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-hangup] {
        grid-column: 1 / -1;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-more-menu]:not([hidden]),
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-incoming] .softphone-incoming-actions,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-disposition-panel] .softphone-wrapup-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-more-menu] [data-softphone-open-tab],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-more-menu] [data-softphone-audio-toggle] {
        min-height: var(--zxp-mobile-touch-target-min, 44px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-custom-call] {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-custom-number],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-disposition-select],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-disposition-notes],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-live-note],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-input-device],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-speaker-device],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-ringtone-device] {
        width: 100%;
        min-width: 0;
        font-size: 16px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-workspace]:not([hidden]) {
        display: grid;
        gap: 10px;
        max-height: min(var(--zxp-mobile-softphone-expanded-max-height, 620px), calc(var(--zxp-softphone-mobile-viewport-height, var(--zxp-mobile-viewport-height, 100dvh)) - 112px));
        overflow: hidden;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-workspace] [role="tablist"] {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-workspace] [role="tablist"]::-webkit-scrollbar {
        display: none;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-workspace-tab] {
        flex: 0 0 auto;
        min-height: 38px;
        white-space: nowrap;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-workspace-panel]:not([hidden]) {
        min-width: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-keypad]:not([hidden]) {
        gap: 8px;
        padding: 10px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-key] {
        min-height: 48px;
        font-size: 1.08rem;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-notifications],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport .softphone-notifications {
        gap: 6px;
    }
}

@media (max-width: 420px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] {
        --zxp-mobile-softphone-edge-gap: 8px;
        border-radius: 20px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-active] .softphone-primary-controls,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-more-menu]:not([hidden]),
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-incoming] .softphone-incoming-actions,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-disposition-panel] .softphone-wrapup-actions {
        grid-template-columns: 1fr;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root] {
        max-height: calc(var(--zxp-softphone-mobile-viewport-height, 100dvh) - var(--zxp-mobile-safe-top, 0px) - var(--zxp-mobile-safe-bottom, 0px) - 12px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-body] {
        max-height: calc(var(--zxp-softphone-mobile-viewport-height, 100dvh) - var(--zxp-mobile-safe-top, 0px) - var(--zxp-mobile-safe-bottom, 0px) - 74px);
    }
}


/* Stage 2 Pass 3: mobile softphone interaction polish. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] {
        -webkit-tap-highlight-color: transparent;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] .softphone-header {
        user-select: none;
        -webkit-user-select: none;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"][data-softphone-mobile-collapsed="true"] .softphone-header,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"][data-softphone-mobile-collapsed="true"] [data-softphone-compact-call] {
        cursor: pointer;
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"][data-softphone-mobile-expanded="true"] [data-softphone-body] {
        display: block;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-collapse],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-workspace-close],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-add-close],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-transfer-close] {
        min-width: var(--zxp-mobile-touch-target-min, 44px);
        min-height: var(--zxp-mobile-touch-target-min, 44px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-active] .softphone-primary-controls,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-incoming] .softphone-incoming-actions,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-disposition-panel] .softphone-wrapup-actions {
        gap: var(--zxp-mobile-softphone-action-gap, 8px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-active] .softphone-primary-controls .button,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-incoming] .button,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-disposition-panel] .button,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-compact-controls] button {
        border-radius: var(--zxp-mobile-softphone-action-radius, 14px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-active] .softphone-primary-controls .button:active,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-incoming] .button:active,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-disposition-panel] .button:active,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-compact-controls] button:active {
        transform: scale(var(--zxp-mobile-softphone-press-scale, 0.985));
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-workspace-body],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"] [data-softphone-workspace-panel]:not([hidden]) {
        overscroll-behavior: contain;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport.zxp-softphone-mobile-keyboard-open [data-softphone-root][data-softphone-mobile-interaction-layer="stage2-pass3"][data-softphone-mobile-workspace-open="true"] [data-softphone-workspace] {
        max-height: calc(var(--zxp-softphone-mobile-viewport-height, 100dvh) - var(--zxp-mobile-safe-top, 0px) - var(--zxp-mobile-safe-bottom, 0px) - 86px);
    }
}


/* Stage 2 Pass 4: mobile call focus and action priority. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-call-focus="true"] {
        --zxp-mobile-softphone-height: var(--zxp-mobile-softphone-active-height, 172px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="incoming"] {
        --zxp-mobile-softphone-height: calc(var(--zxp-mobile-softphone-active-height, 172px) + 16px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"] .softphone-mobile-priority-action {
        min-height: var(--zxp-mobile-softphone-priority-action-height, 54px);
        font-weight: 700;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"] .softphone-mobile-priority-action:focus-visible {
        outline-offset: var(--zxp-mobile-softphone-focus-ring-space, 3px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="incoming"] [data-softphone-incoming]:not([hidden]) {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="incoming"] [data-softphone-incoming] .softphone-incoming-actions {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
        align-items: stretch;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="active"] [data-softphone-active]:not([hidden]) .softphone-primary-controls,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="wrapup"] [data-softphone-disposition-panel]:not([hidden]) .softphone-wrapup-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding-top: 8px;
        margin-bottom: -2px;
        backdrop-filter: blur(10px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="active"][data-softphone-mobile-collapsed="true"] [data-softphone-compact-controls]:not([hidden]) {
        align-items: stretch;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="active"][data-softphone-mobile-collapsed="true"] [data-softphone-compact-controls] button {
        min-height: 48px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="wrapup"] [data-softphone-disposition-select],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="wrapup"] [data-softphone-disposition-notes] {
        min-height: var(--zxp-mobile-touch-target-min, 44px);
    }
}

@media (max-width: 420px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-call-focus-layer="stage2-pass4"][data-softphone-mobile-focus-mode="incoming"] [data-softphone-incoming] .softphone-incoming-actions {
        grid-template-columns: 1fr;
    }
}


/* Stage 2 Pass 5: mobile softphone core closure and accessibility safeguards. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"][data-softphone-mobile-stage2-complete="true"] {
        scroll-margin-bottom: calc(var(--zxp-mobile-shell-bottom-offset, 0px) + 12px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"] [data-softphone-mobile-tap-target="expand"] {
        cursor: pointer;
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"] button:focus-visible,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"] .button:focus-visible,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"] [data-softphone-mobile-tap-target="expand"]:focus-visible {
        outline-width: var(--zxp-mobile-softphone-focus-outline-width, 3px);
        outline-offset: var(--zxp-mobile-softphone-focus-ring-space, 3px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"] [data-softphone-workspace-panel]:not([hidden]) {
        scroll-padding-bottom: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + 18px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"] .softphone-mobile-priority-action {
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport.zxp-softphone-mobile-stage2-complete [data-softphone-root][data-softphone-mobile-focus-mode="wrapup"] [data-softphone-disposition-notes] {
        scroll-margin-bottom: calc(var(--zxp-mobile-keyboard-inset, 0px) + 96px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-zxp-app-surface="workspace"] [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"],
    body[data-zxp-app-surface="workspace"] [data-softphone-root][data-softphone-mobile-accessibility-layer="stage2-pass5"] * {
        scroll-behavior: auto;
        transition-duration: 0.001ms;
        animation-duration: 0.001ms;
    }
}


/* Stage 2 Pass 6: mobile softphone core QA cleanup and lifecycle safeguards. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-core-qa-layer="stage2-pass6"] {
        scroll-padding-bottom: calc(var(--zxp-mobile-safe-bottom, 0px) + var(--zxp-mobile-softphone-action-gap, 8px));
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-core-qa-layer="stage2-pass6"][data-softphone-mobile-has-priority-action="true"] .softphone-mobile-priority-action[data-softphone-mobile-priority-ready="true"] {
        min-height: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + 2px);
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-core-qa-layer="stage2-pass6"] [data-softphone-mobile-priority-ready="false"] {
        cursor: default;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-viewport [data-softphone-root][data-softphone-mobile-core-qa-layer="stage2-pass6"][data-softphone-mobile-page-visible="false"] {
        transition-duration: 0.001ms;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-page-hidden [data-softphone-root][data-softphone-mobile-core-qa-layer="stage2-pass6"] * {
        animation-duration: 0.001ms;
    }
}


/* Stage 3 Pass 1: mobile browser reliability foundation. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-browser-reliability-ready [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"] {
        max-width: calc(100vw - (var(--zxp-mobile-softphone-browser-edge-gap, 10px) * 2));
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-no-visual-viewport [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"] {
        --zxp-softphone-mobile-viewport-height: var(--zxp-mobile-softphone-browser-viewport-fallback, 100dvh);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-ios [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-android [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"] {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-safari [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"] [data-softphone-body],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-standalone [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"] [data-softphone-body] {
        -webkit-overflow-scrolling: touch;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-browser-risk [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"] [data-softphone-workspace-panel]:not([hidden]) {
        overscroll-behavior-y: contain;
        scroll-padding-bottom: calc(var(--zxp-mobile-softphone-priority-action-height, 54px) + var(--zxp-mobile-safe-bottom, 0px) + 20px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-offline [data-softphone-root][data-softphone-mobile-browser-reliability-layer="stage3-pass1"] {
        outline-offset: 2px;
    }
}

/* Stage 3 Pass 2: mobile browser resync hardening. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-browser-resync-ready [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"] {
        scroll-padding-bottom: var(--zxp-mobile-softphone-resync-scroll-padding, 78px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-resync-pending [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"] {
        transition-duration: var(--zxp-mobile-softphone-resync-settle-duration, 0.001ms);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-resync-pending [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"] [data-softphone-workspace-panel]:not([hidden]),
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-resync-pending [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"] [data-softphone-body] {
        overscroll-behavior-y: contain;
        scroll-padding-bottom: var(--zxp-mobile-softphone-resync-scroll-padding, 78px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-page-hidden.zxp-softphone-mobile-resync-pending [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"] * {
        animation-duration: var(--zxp-mobile-softphone-resync-settle-duration, 0.001ms);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-offline [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"] {
        scroll-margin-bottom: var(--zxp-mobile-softphone-resync-scroll-padding, 78px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-ios.zxp-softphone-mobile-resync-pending [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-android.zxp-softphone-mobile-resync-pending [data-softphone-root][data-softphone-mobile-browser-resync-layer="stage3-pass2"] {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}


/* Stage 3 Pass 3: mobile media readiness hardening. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-media-readiness-ready [data-softphone-root][data-softphone-mobile-media-readiness-layer="stage3-pass3"] {
        scroll-padding-bottom: var(--zxp-mobile-softphone-media-readiness-scroll-padding, 86px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-media-needs-attention [data-softphone-root][data-softphone-mobile-media-readiness-layer="stage3-pass3"] [data-softphone-body] {
        scroll-padding-bottom: var(--zxp-mobile-softphone-media-readiness-scroll-padding, 86px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-media-needs-user-gesture [data-softphone-root][data-softphone-mobile-media-readiness-layer="stage3-pass3"] [data-softphone-compact-call],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-media-needs-user-gesture [data-softphone-root][data-softphone-mobile-media-readiness-layer="stage3-pass3"] .softphone-header {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-media-permission-blocked [data-softphone-root][data-softphone-mobile-media-readiness-layer="stage3-pass3"] [data-softphone-workspace-panel="audio"] {
        scroll-margin-bottom: var(--zxp-mobile-softphone-media-readiness-scroll-padding, 86px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-media-ready [data-softphone-root][data-softphone-mobile-media-readiness-layer="stage3-pass3"] [data-softphone-audio-toggle],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-audio-context-running [data-softphone-root][data-softphone-mobile-media-readiness-layer="stage3-pass3"] [data-softphone-test-audio] {
        min-height: var(--zxp-mobile-touch-target-min, 44px);
    }
}


/* Stage 3 Pass 4: mobile connection recovery hardening. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-connection-recovery-ready [data-softphone-root][data-softphone-mobile-connection-recovery-layer="stage3-pass4"] {
        scroll-padding-bottom: var(--zxp-mobile-softphone-connection-recovery-scroll-padding, 94px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-connection-degraded [data-softphone-root][data-softphone-mobile-connection-recovery-layer="stage3-pass4"] [data-softphone-body],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-connection-recovery-needed [data-softphone-root][data-softphone-mobile-connection-recovery-layer="stage3-pass4"] [data-softphone-body] {
        overscroll-behavior-y: contain;
        scroll-padding-bottom: var(--zxp-mobile-softphone-connection-recovery-scroll-padding, 94px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-offline [data-softphone-root][data-softphone-mobile-connection-recovery-layer="stage3-pass4"] {
        scroll-margin-bottom: var(--zxp-mobile-softphone-connection-recovery-scroll-padding, 94px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-reconnected [data-softphone-root][data-softphone-mobile-connection-recovery-layer="stage3-pass4"] {
        transition-duration: var(--zxp-mobile-softphone-connection-recovery-settle-duration, 0.001ms);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-connection-degraded [data-softphone-root][data-softphone-mobile-connection-recovery-layer="stage3-pass4"] .softphone-mobile-priority-action {
        min-height: var(--zxp-mobile-softphone-priority-action-height, 54px);
        touch-action: manipulation;
    }
}


/* Stage 3 Pass 5: mobile browser diagnostics QA closure. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage3-browser-qa-ready [data-softphone-root][data-softphone-mobile-stage3-qa-layer="stage3-pass5"] {
        scroll-padding-bottom: var(--zxp-mobile-softphone-stage3-qa-scroll-padding, 102px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage3-browser-diagnostics-needed [data-softphone-root][data-softphone-mobile-stage3-qa-layer="stage3-pass5"] [data-softphone-body] {
        overscroll-behavior-y: contain;
        scroll-padding-bottom: var(--zxp-mobile-softphone-stage3-qa-scroll-padding, 102px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage3-browser-diagnostics-ready [data-softphone-root][data-softphone-mobile-stage3-qa-layer="stage3-pass5"] .softphone-mobile-priority-action {
        min-height: var(--zxp-mobile-softphone-priority-action-height, 54px);
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage3-browser-diagnostics-ready.zxp-softphone-mobile-resync-pending [data-softphone-root][data-softphone-mobile-stage3-qa-layer="stage3-pass5"],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage3-browser-diagnostics-ready.zxp-softphone-mobile-reconnected [data-softphone-root][data-softphone-mobile-stage3-qa-layer="stage3-pass5"] {
        transition-duration: var(--zxp-mobile-softphone-stage3-qa-settle-duration, 0.001ms);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage3-browser-diagnostics-needed [data-softphone-root][data-softphone-mobile-stage3-qa-layer="stage3-pass5"] [data-softphone-workspace-panel]:not([hidden]) {
        scroll-margin-bottom: var(--zxp-mobile-softphone-stage3-qa-scroll-padding, 102px);
    }
}

/* Stage 4 Pass 1: mobile communications workflow contract. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-workflow-contract-ready [data-softphone-root][data-softphone-mobile-stage4-workflow-layer="stage4-pass1"] {
        scroll-padding-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-workflow-contract-ready :where(
        .zxp-list-workspace--contacts,
        .zxp-contact-record-hero,
        .conversation-index-grid,
        .conversation-layout,
        .call-transcript-details,
        .crm-tasks-page,
        .zxp-notifications-workspace,
        .dialer-workspace
    ) {
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-workflow-contract-ready :where(
        [data-softphone-call-contact],
        [data-contact-email-open],
        .conversation-primary-call,
        .conversation-message-form button,
        [data-dialer-call-button],
        [data-dialer-save-next],
        [data-dialer-skip-lead]
    ) {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-workflow-contract-ready :where(
        .conversation-message-form textarea,
        .contact-email-composer textarea,
        .dialer-notes-label textarea
    ) {
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-workflow-surface-active [data-softphone-root][data-softphone-mobile-stage4-workflow-layer="stage4-pass1"] [data-softphone-body] {
        overscroll-behavior-y: contain;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-workflow-action-ready [data-softphone-root][data-softphone-mobile-stage4-workflow-layer="stage4-pass1"] .softphone-mobile-priority-action {
        min-height: var(--zxp-mobile-softphone-priority-action-height, 54px);
    }
}

.contact-mobile-communication-actions {
    display: none;
}

/* Stage 4 Pass 2: mobile contact communication action rail. */
@media (max-width: 760px) {
    .contact-profile-hero.zxp-contact-record-hero {
        scroll-margin-top: var(--zxp-mobile-contact-actions-sticky-top, 0.5rem);
    }

    .contact-mobile-communication-actions[data-stage4-contact-actions="stage4-pass2"] {
        display: flex;
        flex-direction: column;
        gap: var(--zxp-mobile-contact-actions-gap, 0.55rem);
        width: 100%;
        padding: 0.75rem;
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
    }

    .contact-mobile-action-context {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        font-size: 0.82rem;
        line-height: 1.3;
    }

    .contact-mobile-action-context span {
        color: #64748b;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .contact-mobile-action-context strong {
        text-align: right;
        word-break: break-word;
    }

    .contact-mobile-action-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--zxp-mobile-contact-actions-gap, 0.55rem);
    }

    .contact-mobile-action-button {
        min-height: var(--zxp-mobile-contact-actions-min-height, 48px);
        justify-content: center;
        text-align: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .contact-mobile-action-button.is-disabled,
    .contact-mobile-action-button[aria-disabled="true"],
    .contact-mobile-action-button:disabled {
        pointer-events: none;
        opacity: 0.58;
    }

    .contact-mobile-action-button.is-limited {
        border-style: dashed;
    }

    .contact-mobile-action-helper {
        margin: 0;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-contact-actions-ready .contact-mobile-communication-actions[data-stage4-contact-actions="stage4-pass2"] {
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-contact-phone-missing .contact-mobile-action-call,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-contact-phone-missing .contact-mobile-action-sms {
        min-height: var(--zxp-mobile-contact-actions-min-height, 48px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-contact-call-ready .contact-mobile-action-call,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-contact-sms-ready .contact-mobile-action-sms,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-contact-email-ready .contact-mobile-action-email,
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-contact-follow-up-ready .contact-mobile-action-follow-up {
        min-height: var(--zxp-mobile-contact-actions-min-height, 48px);
    }
}


.sms-mobile-conversation-actions {
    display: none;
}

.sms-mobile-open-indicator {
    display: none;
}

/* Stage 4 Pass 3: SMS inbox and conversation mobile upgrade. */
@media (max-width: 760px) {
    .sms-mobile-inbox-shell[data-stage4-sms-inbox="stage4-pass3"],
    .sms-mobile-conversation-shell[data-stage4-sms-conversation="stage4-pass3"] {
        scroll-margin-top: var(--zxp-mobile-contact-actions-sticky-top, 0.5rem);
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .sms-mobile-inbox-header {
        gap: var(--zxp-mobile-sms-card-gap, 0.7rem);
    }

    .sms-mobile-summary-strip[data-mobile-sms-inbox-summary] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--zxp-mobile-sms-card-gap, 0.7rem);
        margin: 0.85rem 0;
    }

    .sms-mobile-summary-strip[data-mobile-sms-inbox-summary] > div {
        min-width: 0;
        padding: 0.75rem;
        border: 1px solid rgba(148, 163, 184, 0.26);
        border-radius: 16px;
        background: rgba(248, 250, 252, 0.86);
    }

    .sms-mobile-summary-strip[data-mobile-sms-inbox-summary] strong {
        display: block;
        margin-top: 0.25rem;
        font-size: 0.92rem;
        line-height: 1.2;
        word-break: break-word;
    }

    .sms-mobile-index-grid[data-mobile-sms-index-grid] {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--zxp-mobile-sms-card-gap, 0.7rem);
    }

    .sms-mobile-list-card[data-mobile-sms-inbox-list],
    .sms-mobile-list-card[data-mobile-sms-start-list] {
        min-height: auto;
    }

    .sms-mobile-conversation-scroll[data-mobile-sms-conversation-scroll],
    .sms-mobile-start-scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .sms-mobile-conversation-card[data-mobile-sms-conversation-card],
    .sms-mobile-start-card[data-mobile-sms-start-card] {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: var(--zxp-mobile-sms-card-gap, 0.7rem);
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .sms-mobile-conversation-title-row {
        align-items: flex-start;
    }

    .sms-mobile-conversation-time {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.35rem;
        white-space: normal;
        text-align: right;
    }

    .sms-mobile-open-indicator {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        padding: 0.18rem 0.45rem;
        background: rgba(37, 99, 235, 0.10);
        color: #1d4ed8;
        font-size: 0.72rem;
        font-weight: 900;
    }

    .sms-mobile-open-button[data-mobile-sms-start-action] {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
    }

    .sms-mobile-conversation-actions[data-mobile-sms-conversation-actions] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--zxp-mobile-sms-card-gap, 0.7rem);
        margin-top: 0.9rem;
    }

    .sms-mobile-conversation-actions[data-mobile-sms-conversation-actions] form {
        display: flex;
        min-width: 0;
    }

    .sms-mobile-action-button {
        width: 100%;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .sms-mobile-conversation-layout[data-mobile-sms-conversation-layout] {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--zxp-mobile-sms-card-gap, 0.7rem);
    }

    .sms-mobile-thread-card {
        min-height: auto;
    }

    .sms-mobile-thread[data-mobile-sms-thread] {
        max-height: var(--zxp-mobile-sms-thread-max-height);
        min-height: 260px;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 0;
        scroll-padding-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .sms-mobile-thread[data-mobile-sms-thread] .conversation-row {
        min-width: 0;
    }

    .sms-mobile-thread[data-mobile-sms-thread] .conversation-bubble {
        width: 100%;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .sms-mobile-thread[data-mobile-sms-thread] .conversation-meta {
        gap: 0.35rem;
        line-height: 1.35;
    }

    .sms-mobile-thread[data-mobile-sms-thread] .conversation-meta span:not(:last-child)::after {
        margin-left: 0.35rem;
    }

    .sms-mobile-side-stack {
        gap: var(--zxp-mobile-sms-card-gap, 0.7rem);
    }

    .sms-mobile-composer-card {
        position: sticky;
        bottom: var(--zxp-mobile-sms-composer-sticky-bottom);
        z-index: 12;
        min-height: auto;
        border-top-color: #2563eb;
    }

    .sms-mobile-composer-card .conversation-message-form textarea[data-mobile-sms-composer-textarea] {
        min-height: 118px;
        max-height: min(220px, calc(var(--zxp-mobile-layout-viewport-height, 100dvh) * 0.32));
        font-size: 16px;
        resize: vertical;
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .sms-mobile-composer-card [data-mobile-sms-send-action],
    .sms-mobile-call-panel [data-mobile-sms-call-action] {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        justify-content: center;
        touch-action: manipulation;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-sms-workflow-active :where(
        .sms-mobile-inbox-shell,
        .sms-mobile-conversation-shell,
        .sms-mobile-index-grid,
        .sms-mobile-conversation-layout
    ) {
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-sms-keyboard-safe .sms-mobile-composer-card {
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-sms-unreviewed .sms-mobile-conversation-card[data-sms-has-unreviewed="true"] {
        border-width: 2px;
    }
}

@media (max-width: 420px) {
    .sms-mobile-summary-strip[data-mobile-sms-inbox-summary],
    .sms-mobile-conversation-actions[data-mobile-sms-conversation-actions] {
        grid-template-columns: 1fr;
    }

    .sms-mobile-conversation-card[data-mobile-sms-conversation-card],
    .sms-mobile-start-card[data-mobile-sms-start-card] {
        grid-template-columns: 1fr;
    }

    .sms-mobile-conversation-time {
        align-items: flex-start;
        text-align: left;
    }
}


.call-log-mobile-summary-strip,
.call-log-mobile-list {
    display: none;
}

/* Stage 4 Pass 4: call log follow-up mobile upgrade. */
@media (max-width: 760px) {
    .call-logs-mobile-shell[data-stage4-call-logs="stage4-pass4"] {
        scroll-margin-top: var(--zxp-mobile-contact-actions-sticky-top, 0.5rem);
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .call-logs-mobile-header[data-mobile-call-log-header] {
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
    }

    .call-log-mobile-summary-strip[data-mobile-call-log-summary] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
        margin: 0.85rem 0;
    }

    .call-log-mobile-summary-strip[data-mobile-call-log-summary] > div {
        min-width: 0;
        padding: 0.75rem;
        border: 1px solid rgba(148, 163, 184, 0.26);
        border-radius: 16px;
        background: rgba(248, 250, 252, 0.86);
    }

    .call-log-mobile-summary-strip[data-mobile-call-log-summary] strong {
        display: block;
        margin-top: 0.25rem;
        font-size: 1rem;
        line-height: 1.2;
    }

    .call-log-mobile-filter-card[data-mobile-call-log-filter-card] {
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .call-log-mobile-filter-card[data-mobile-call-log-filter-card] .grid-3 {
        grid-template-columns: 1fr;
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
    }

    .call-log-mobile-filter-card[data-mobile-call-log-filter-card] :where(input, select, button, .button) {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        font-size: 16px;
        touch-action: manipulation;
    }

    .call-log-mobile-filter-actions[data-mobile-call-log-filter-actions] {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
    }

    .call-log-mobile-list[data-mobile-call-log-list] {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
        margin: 0.85rem 0;
        scroll-padding-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .call-log-mobile-card[data-mobile-call-log-card] {
        display: grid;
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
        min-width: 0;
        border-radius: 18px;
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .call-log-mobile-card[data-mobile-call-log-card].is-missed,
    .call-log-mobile-card[data-mobile-call-log-card].is-voicemail,
    .call-log-mobile-card[data-mobile-call-log-card].needs-review {
        border-width: 2px;
    }

    .call-log-mobile-card-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
    }

    .call-log-mobile-card-header h3 {
        margin: 0;
        overflow-wrap: anywhere;
    }

    .call-log-mobile-status[data-mobile-call-log-status] {
        white-space: nowrap;
    }

    .call-log-mobile-meta-grid[data-mobile-call-log-meta] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
    }

    .call-log-mobile-meta-grid[data-mobile-call-log-meta] > div {
        min-width: 0;
        padding: 0.65rem;
        border-radius: 14px;
        background: rgba(248, 250, 252, 0.92);
    }

    .call-log-mobile-meta-grid[data-mobile-call-log-meta] span,
    .call-log-mobile-media-stack[data-mobile-call-log-media] .muted {
        display: block;
        margin-bottom: 0.25rem;
    }

    .call-log-mobile-meta-grid[data-mobile-call-log-meta] strong {
        overflow-wrap: anywhere;
    }

    .call-log-mobile-action-row[data-mobile-call-log-actions] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
    }

    .call-log-mobile-action {
        width: 100%;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        text-align: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .call-log-mobile-action.is-disabled,
    .call-log-mobile-action[aria-disabled="true"],
    .call-log-mobile-action:disabled {
        pointer-events: none;
        opacity: 0.58;
    }

    .call-log-mobile-media-stack[data-mobile-call-log-media] {
        display: grid;
        gap: var(--zxp-mobile-call-log-card-gap, 0.72rem);
    }

    .call-log-mobile-recording[data-mobile-call-log-recording] {
        display: grid;
        gap: 0.45rem;
        min-width: 0;
    }

    .call-log-mobile-recording[data-mobile-call-log-recording] audio {
        width: 100%;
        max-width: 100%;
    }

    .call-log-mobile-transcript[data-mobile-call-log-transcript] {
        min-width: 0;
    }

    .call-log-mobile-transcript[data-mobile-call-log-transcript] summary {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        display: flex;
        align-items: center;
        touch-action: manipulation;
    }

    .call-log-mobile-transcript[data-mobile-call-log-transcript] .call-transcript-preview {
        max-width: 100%;
        max-height: var(--zxp-mobile-call-log-media-max-height);
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        font-size: 13px;
        line-height: 1.5;
    }

    .call-log-desktop-table-card[data-mobile-call-log-table-card] {
        display: none;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-call-log-workflow-active :where(
        .call-logs-mobile-shell,
        .call-log-mobile-list,
        .call-log-mobile-card,
        .call-log-mobile-filter-card
    ) {
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-call-log-follow-up-ready .call-log-mobile-callback[data-mobile-call-log-callback-action] {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-call-log-review-needed .call-log-mobile-card[data-call-log-review-status]:not([data-call-log-review-status="reviewed"]) {
        border-width: 2px;
    }
}

@media (max-width: 420px) {
    .call-log-mobile-summary-strip[data-mobile-call-log-summary],
    .call-log-mobile-meta-grid[data-mobile-call-log-meta],
    .call-log-mobile-action-row[data-mobile-call-log-actions],
    .call-log-mobile-filter-actions[data-mobile-call-log-filter-actions] {
        grid-template-columns: 1fr;
    }

    .call-log-mobile-card-header {
        grid-template-columns: 1fr;
    }

    .call-log-mobile-status[data-mobile-call-log-status] {
        justify-self: start;
    }
}

.softphone-mobile-diagnostics[data-softphone-mobile-diagnostics] {
    display: none;
}

/* Stage 4 Pass 5: visible mobile diagnostics and recovery UI. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-diagnostics-ui-ready [data-softphone-root][data-softphone-mobile-stage4-diagnostics-ui-layer="stage4-pass5"] {
        scroll-padding-bottom: var(--zxp-mobile-diagnostics-ui-scroll-padding, 126px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-diagnostics-ui-ready [data-softphone-mobile-diagnostics][data-softphone-mobile-diagnostics-layer="stage4-pass5"] {
        border-radius: var(--zxp-mobile-diagnostics-ui-radius, 16px);
        gap: var(--zxp-mobile-diagnostics-ui-gap, 0.55rem);
        scroll-margin-bottom: var(--zxp-mobile-diagnostics-ui-scroll-padding, 126px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-diagnostics-ui-visible [data-softphone-mobile-diagnostics][data-softphone-mobile-diagnostics-layer="stage4-pass5"] {
        display: grid;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-diagnostics-ui-attention [data-softphone-mobile-diagnostics][data-softphone-mobile-diagnostics-layer="stage4-pass5"] {
        border-width: 2px;
    }

    .softphone-mobile-diagnostics-heading {
        display: grid;
        gap: 0.2rem;
        min-width: 0;
    }

    .softphone-mobile-diagnostics-heading strong,
    .softphone-mobile-diagnostics-heading span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .softphone-mobile-diagnostics-pills[data-softphone-mobile-diagnostics-pills] {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        min-width: 0;
    }

    .softphone-mobile-diagnostics-pills[data-softphone-mobile-diagnostics-pills] span {
        border: 1px solid rgba(15, 23, 42, 0.14);
        border-radius: 999px;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.1;
        padding: 0.32rem 0.5rem;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .softphone-mobile-diagnostics-actions[data-softphone-mobile-diagnostics-actions] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        min-width: 0;
    }

    .softphone-mobile-diagnostics-actions[data-softphone-mobile-diagnostics-actions] button {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        min-width: 0;
        touch-action: manipulation;
        white-space: normal;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-diagnostics-ui-visible [data-softphone-root][data-softphone-mobile-stage4-diagnostics-ui-layer="stage4-pass5"] [data-softphone-body] {
        overscroll-behavior-y: contain;
        scroll-padding-bottom: var(--zxp-mobile-diagnostics-ui-scroll-padding, 126px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-diagnostics-ui-audio-action [data-softphone-mobile-diagnostics-enable-audio] {
        min-height: calc(var(--zxp-mobile-communications-workflow-touch-target, 46px) + 2px);
    }
}

@media (max-width: 420px) {
    .softphone-mobile-diagnostics-actions[data-softphone-mobile-diagnostics-actions] {
        grid-template-columns: 1fr;
    }
}

.softphone-mobile-active-status[data-softphone-mobile-active-status] {
    display: none;
}

/* Stage 4 Pass 6: active call workspace mobile polish. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-active-call-workspace-ready [data-softphone-root][data-softphone-mobile-stage4-active-call-workspace-layer="stage4-pass6"] {
        scroll-padding-bottom: var(--zxp-mobile-active-call-workspace-scroll-padding, 150px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-active-call-workspace-visible [data-softphone-mobile-active-status][data-softphone-mobile-active-workspace-layer="stage4-pass6"] {
        display: grid;
        gap: 0.2rem;
        border-radius: var(--zxp-mobile-active-call-workspace-radius, 18px);
        min-width: 0;
        scroll-margin-bottom: var(--zxp-mobile-active-call-workspace-scroll-padding, 150px);
    }

    .softphone-active-redesigned[data-softphone-mobile-active-workspace="stage4-pass6"],
    .softphone-incoming[data-softphone-mobile-active-workspace="stage4-pass6"],
    .softphone-disposition-panel[data-softphone-mobile-active-workspace="stage4-pass6"] {
        display: grid;
        gap: var(--zxp-mobile-active-call-workspace-gap, 0.62rem);
        min-width: 0;
    }

    .softphone-active-heading[data-softphone-mobile-active-heading] {
        align-items: start;
        gap: 0.65rem;
        min-width: 0;
    }

    .softphone-active-heading[data-softphone-mobile-active-heading] > div,
    .softphone-mobile-active-status[data-softphone-mobile-active-status] strong,
    .softphone-mobile-active-status[data-softphone-mobile-active-status] span,
    .softphone-timer-stack[data-softphone-mobile-active-timer-stack] {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .softphone-primary-controls[data-softphone-mobile-active-controls] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        min-width: 0;
    }

    .softphone-primary-controls[data-softphone-mobile-active-controls] button,
    .softphone-incoming-actions[data-softphone-mobile-incoming-actions] button,
    .softphone-more-menu[data-softphone-mobile-active-more-menu] button,
    .softphone-wrapup-actions[data-softphone-mobile-wrapup-actions] button {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        min-width: 0;
        touch-action: manipulation;
        white-space: normal;
    }

    .softphone-primary-controls[data-softphone-mobile-active-controls] [data-softphone-mobile-active-action="hangup"] {
        grid-column: 1 / -1;
        min-height: calc(var(--zxp-mobile-communications-workflow-touch-target, 46px) + 8px);
        margin-top: 0.1rem;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-active-call-hangup-protected [data-softphone-mobile-active-action="hangup"] {
        scroll-margin-bottom: var(--zxp-mobile-active-call-workspace-scroll-padding, 150px);
    }

    .softphone-incoming-actions[data-softphone-mobile-incoming-actions],
    .softphone-wrapup-actions[data-softphone-mobile-wrapup-actions],
    .softphone-more-menu[data-softphone-mobile-active-more-menu] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        min-width: 0;
    }

    [data-softphone-workspace][data-softphone-mobile-active-workspace="stage4-pass6"] {
        max-height: var(--zxp-mobile-active-call-workspace-panel-max-height, 460px);
        overflow: hidden;
        overscroll-behavior: contain;
        scroll-margin-bottom: var(--zxp-mobile-active-call-workspace-scroll-padding, 150px);
    }

    [data-softphone-mobile-workspace-header] {
        align-items: start;
        gap: 0.75rem;
        min-width: 0;
    }

    [data-softphone-mobile-active-tabs] {
        display: flex;
        gap: 0.45rem;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-bottom: 0.2rem;
        -webkit-overflow-scrolling: touch;
    }

    [data-softphone-mobile-active-tabs] [data-softphone-mobile-active-tab] {
        flex: 0 0 auto;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        touch-action: manipulation;
    }

    [data-softphone-mobile-active-workspace-body] {
        max-height: calc(var(--zxp-mobile-active-call-workspace-panel-max-height, 460px) - 118px);
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scroll-padding-bottom: var(--zxp-mobile-active-call-workspace-scroll-padding, 150px);
        -webkit-overflow-scrolling: touch;
    }

    [data-softphone-mobile-workspace-panel],
    [data-softphone-mobile-workspace-call-card],
    .softphone-live-notes[data-softphone-mobile-live-notes],
    .softphone-audio-panel[data-softphone-mobile-audio-panel] {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .softphone-keypad[data-softphone-mobile-keypad-grid] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .softphone-keypad[data-softphone-mobile-keypad-grid] button {
        min-height: 48px;
        touch-action: manipulation;
    }

    textarea[data-softphone-mobile-live-note],
    textarea[data-softphone-mobile-wrapup-notes],
    select[data-softphone-mobile-wrapup-select] {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        scroll-margin-bottom: var(--zxp-mobile-active-call-workspace-scroll-padding, 150px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-keyboard-open [data-softphone-mobile-live-note],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-keyboard-open [data-softphone-mobile-wrapup-notes] {
        min-height: 110px;
    }
}

@media (max-width: 420px) {
    .softphone-primary-controls[data-softphone-mobile-active-controls],
    .softphone-incoming-actions[data-softphone-mobile-incoming-actions],
    .softphone-wrapup-actions[data-softphone-mobile-wrapup-actions],
    .softphone-more-menu[data-softphone-mobile-active-more-menu] {
        grid-template-columns: 1fr;
    }

    .softphone-primary-controls[data-softphone-mobile-active-controls] [data-softphone-mobile-active-action="hangup"] {
        grid-column: auto;
    }
}

.dialer-mobile-run-summary[data-mobile-power-dialer-summary] {
    display: none;
}

/* Stage 4 Pass 7: power dialer mobile run mode. */
@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-stage4-power-dialer-workflow-ready [data-stage4-power-dialer="stage4-pass7"] {
        max-width: 100%;
        padding-right: 0;
        padding-bottom: var(--zxp-mobile-power-dialer-scroll-padding, 162px);
        scroll-padding-bottom: var(--zxp-mobile-power-dialer-scroll-padding, 162px);
    }

    [data-stage4-power-dialer="stage4-pass7"] .dialer-topbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--zxp-mobile-power-dialer-gap, 0.72rem);
        margin-bottom: var(--zxp-mobile-power-dialer-gap, 0.72rem);
    }

    [data-stage4-power-dialer="stage4-pass7"] .dialer-title h1 {
        font-size: clamp(1.65rem, 8vw, 2.15rem);
        line-height: 1.08;
        overflow-wrap: anywhere;
    }

    [data-stage4-power-dialer="stage4-pass7"] .dialer-title p,
    [data-stage4-power-dialer="stage4-pass7"] .dialer-auto-notice,
    [data-stage4-power-dialer="stage4-pass7"] .lead-company {
        overflow-wrap: anywhere;
    }

    [data-stage4-power-dialer="stage4-pass7"] .dialer-actions,
    [data-stage4-power-dialer="stage4-pass7"] .dialer-call-row,
    [data-stage4-power-dialer="stage4-pass7"] .dialer-save-row[data-mobile-power-dialer-save-row] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        white-space: normal;
        min-width: 0;
    }

    [data-stage4-power-dialer="stage4-pass7"] .dialer-actions .button,
    [data-stage4-power-dialer="stage4-pass7"] .dialer-call-row .button,
    [data-stage4-power-dialer="stage4-pass7"] .dialer-save-row[data-mobile-power-dialer-save-row] .button,
    [data-stage4-power-dialer="stage4-pass7"] [data-mobile-power-dialer-crm-link] {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        min-width: 0;
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        touch-action: manipulation;
        white-space: normal;
    }

    [data-stage4-power-dialer="stage4-pass7"] [data-mobile-power-dialer-call-action] {
        min-height: calc(var(--zxp-mobile-communications-workflow-touch-target, 46px) + 8px);
    }

    [data-stage4-power-dialer="stage4-pass7"] [data-mobile-power-dialer-status-strip="stage4-pass7"] {
        position: sticky;
        top: var(--zxp-mobile-power-dialer-sticky-top, 0.5rem);
        z-index: 8;
        display: grid;
        gap: 0.55rem;
        border-radius: var(--zxp-mobile-power-dialer-card-radius, 18px);
        scroll-margin-top: var(--zxp-mobile-power-dialer-sticky-top, 0.5rem);
    }

    [data-stage4-power-dialer="stage4-pass7"] .dialer-mobile-run-summary[data-mobile-power-dialer-summary="stage4-pass7"] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }

    [data-stage4-power-dialer="stage4-pass7"] .dialer-mobile-run-summary[data-mobile-power-dialer-summary="stage4-pass7"] span {
        min-width: 0;
        border: 1px solid rgba(15, 23, 42, 0.12);
        border-radius: 14px;
        padding: 0.5rem;
        font-size: 12px;
        font-weight: 800;
        text-align: center;
        overflow-wrap: anywhere;
    }

    [data-mobile-power-dialer-workspace="stage4-pass7"] .dialer-main-grid,
    [data-mobile-power-dialer-workspace="stage4-pass7"] .dialer-context-grid,
    [data-mobile-power-dialer-workspace="stage4-pass7"] .dialer-history-grid[data-mobile-power-dialer-history="stage4-pass7"] {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--zxp-mobile-power-dialer-gap, 0.72rem);
    }

    [data-mobile-power-dialer-workspace="stage4-pass7"] .dialer-card,
    [data-mobile-power-dialer-workspace="stage4-pass7"] .dialer-mini-card,
    [data-mobile-power-dialer-workspace="stage4-pass7"] .dialer-wrapup-panel,
    [data-mobile-power-dialer-empty-state="stage4-pass7"] {
        border-radius: var(--zxp-mobile-power-dialer-card-radius, 18px);
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        scroll-margin-bottom: var(--zxp-mobile-power-dialer-scroll-padding, 162px);
    }

    [data-mobile-power-dialer-lead-card="stage4-pass7"] {
        display: grid;
        gap: var(--zxp-mobile-power-dialer-gap, 0.72rem);
    }

    [data-mobile-power-dialer-lead-heading] {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.4rem;
        min-width: 0;
    }

    [data-mobile-power-dialer-lead-heading] h2 {
        font-size: clamp(1.35rem, 6.4vw, 1.75rem);
        overflow-wrap: anywhere;
    }

    [data-mobile-power-dialer-lead-heading] .status-pill {
        justify-self: start;
        max-width: 100%;
        white-space: normal;
    }

    [data-mobile-power-dialer-lead-details] {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    [data-mobile-power-dialer-lead-details] dt {
        margin-top: 0.35rem;
    }

    [data-mobile-power-dialer-disposition-form="stage4-pass7"] {
        display: grid;
        gap: var(--zxp-mobile-power-dialer-gap, 0.72rem);
        scroll-margin-bottom: var(--zxp-mobile-power-dialer-scroll-padding, 162px);
    }

    [data-mobile-power-dialer-disposition-form="stage4-pass7"] select,
    [data-mobile-power-dialer-disposition-form="stage4-pass7"] textarea,
    [data-mobile-power-dialer-disposition-form="stage4-pass7"] input[type="datetime-local"] {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        max-width: 100%;
        font-size: 16px;
        scroll-margin-bottom: var(--zxp-mobile-power-dialer-scroll-padding, 162px);
    }

    [data-mobile-power-dialer-notes] {
        min-height: 116px;
        resize: vertical;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-keyboard-open [data-mobile-power-dialer-notes],
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-keyboard-open [data-mobile-power-dialer-follow-up-input] {
        scroll-margin-bottom: calc(var(--zxp-mobile-power-dialer-scroll-padding, 162px) + var(--zxp-mobile-layout-keyboard-inset, 0px));
    }

    [data-mobile-power-dialer-local-presence="stage4-pass7"] .checkbox-line {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        touch-action: manipulation;
    }

    [data-mobile-power-dialer-history="stage4-pass7"] {
        max-height: none;
        overflow: visible;
    }

    [data-mobile-power-dialer-attempts-card],
    [data-mobile-power-dialer-dispositions-card] {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    [data-mobile-power-dialer-attempts-table],
    [data-mobile-power-dialer-dispositions-table] {
        min-width: 520px;
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-power-dialer-call-ready [data-mobile-power-dialer-call-action] {
        scroll-margin-bottom: var(--zxp-mobile-power-dialer-scroll-padding, 162px);
    }

    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-power-dialer-wrapup-ready [data-mobile-power-dialer-save-next-action] {
        min-height: calc(var(--zxp-mobile-communications-workflow-touch-target, 46px) + 8px);
    }
}

@media (max-width: 420px) {
    [data-stage4-power-dialer="stage4-pass7"] .dialer-actions,
    [data-stage4-power-dialer="stage4-pass7"] .dialer-call-row,
    [data-stage4-power-dialer="stage4-pass7"] .dialer-save-row[data-mobile-power-dialer-save-row],
    [data-stage4-power-dialer="stage4-pass7"] .dialer-mobile-run-summary[data-mobile-power-dialer-summary="stage4-pass7"] {
        grid-template-columns: 1fr;
    }
}

/* Stage 5 Pass 1: phone-first contact list cards. */
.contact-mobile-card-list {
    display: none;
}

@media (max-width: 760px) {
    .zxp-list-workspace--contacts .zxp-data-table-card {
        display: none;
    }

    .contact-mobile-card-list[data-stage5-contact-cards="stage5-pass1"] {
        display: grid;
        gap: 0.8rem;
        width: 100%;
        min-width: 0;
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .contact-mobile-sort-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.65rem;
        padding: 0.75rem;
        border: 1px solid rgba(148, 163, 184, 0.26);
        border-radius: 16px;
        background: rgba(248, 251, 255, 0.88);
    }

    .contact-mobile-sort-form label {
        display: grid;
        gap: 0.35rem;
        min-width: 0;
        margin: 0;
    }

    .contact-mobile-sort-form label > span,
    .contact-mobile-card-field > span,
    .contact-mobile-card-account > span,
    .contact-mobile-card-detail dt {
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.045em;
        text-transform: uppercase;
    }

    .contact-mobile-sort-form select {
        width: 100%;
        min-width: 0;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        font-size: 16px;
    }

    .contact-mobile-sort-form .button {
        grid-column: 1 / -1;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
    }

    .contact-mobile-card {
        display: grid;
        gap: 0.75rem;
        min-width: 0;
        padding: 0.9rem;
        border: 1px solid rgba(148, 163, 184, 0.26);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
    }

    .contact-mobile-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        min-width: 0;
    }

    .contact-mobile-card-heading {
        display: grid;
        gap: 0.35rem;
        min-width: 0;
    }

    .contact-mobile-card-name {
        color: inherit;
        font-size: 1.04rem;
        font-weight: 900;
        line-height: 1.25;
        overflow-wrap: anywhere;
        text-decoration: none;
    }

    .contact-mobile-card-name:hover,
    .contact-mobile-card-name:focus-visible {
        color: var(--primary);
        text-decoration: underline;
    }

    .contact-mobile-card-account {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.3rem 0.45rem;
        min-width: 0;
    }

    .contact-mobile-card-account a,
    .contact-mobile-card-account strong {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .contact-mobile-card-edit {
        flex: 0 0 auto;
        min-height: 40px;
    }

    .contact-mobile-card-contact-grid,
    .contact-mobile-card-selected-details {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        min-width: 0;
        margin: 0;
    }

    .contact-mobile-card-field,
    .contact-mobile-card-detail {
        display: grid;
        gap: 0.25rem;
        min-width: 0;
        padding: 0.65rem;
        border-radius: 13px;
        background: #f8fbff;
    }

    .contact-mobile-card-field strong,
    .contact-mobile-card-detail dd {
        min-width: 0;
        margin: 0;
        font-size: 0.88rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .contact-mobile-card-status-row,
    .contact-mobile-card-tags {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
        min-width: 0;
    }

    .contact-mobile-card-status-row:empty,
    .contact-mobile-card-selected-details:empty {
        display: none;
    }

    .contact-mobile-card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        min-width: 0;
        padding-top: 0.1rem;
    }

    .contact-mobile-card-actions .button,
    .contact-mobile-card-actions button {
        display: inline-flex;
        width: 100%;
        min-width: 0;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        margin: 0;
        text-align: center;
        touch-action: manipulation;
    }

    .contact-mobile-card-actions .is-disabled {
        cursor: not-allowed;
        opacity: 0.52;
        pointer-events: none;
    }
}

@media (max-width: 420px) {
    .contact-mobile-sort-form,
    .contact-mobile-card-contact-grid,
    .contact-mobile-card-selected-details {
        grid-template-columns: 1fr;
    }
}


/* Stage 5 Pass 2: phone-first account list cards. */
.account-mobile-card-list {
    display: none;
}

@media (max-width: 760px) {
    .zxp-list-workspace--accounts .zxp-data-table-card {
        display: none;
    }

    .account-mobile-card-list[data-stage5-account-cards="stage5-pass2"] {
        display: grid;
        gap: 0.8rem;
        width: 100%;
        min-width: 0;
        scroll-margin-bottom: var(--zxp-mobile-communications-workflow-scroll-padding, 110px);
    }

    .account-mobile-sort-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.65rem;
        padding: 0.75rem;
        border: 1px solid rgba(148, 163, 184, 0.26);
        border-radius: 16px;
        background: rgba(248, 251, 255, 0.88);
    }

    .account-mobile-sort-form label {
        display: grid;
        gap: 0.35rem;
        min-width: 0;
        margin: 0;
    }

    .account-mobile-sort-form label > span,
    .account-mobile-card-field > span,
    .account-mobile-card-detail dt {
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.045em;
        text-transform: uppercase;
    }

    .account-mobile-sort-form select {
        width: 100%;
        min-width: 0;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        font-size: 16px;
    }

    .account-mobile-sort-form .button {
        grid-column: 1 / -1;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
    }

    .account-mobile-card {
        display: grid;
        gap: 0.75rem;
        min-width: 0;
        padding: 0.9rem;
        border: 1px solid rgba(148, 163, 184, 0.26);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
    }

    .account-mobile-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        min-width: 0;
    }

    .account-mobile-card-heading {
        display: grid;
        gap: 0.4rem;
        min-width: 0;
    }

    .account-mobile-card-name {
        color: inherit;
        font-size: 1.04rem;
        font-weight: 900;
        line-height: 1.25;
        overflow-wrap: anywhere;
        text-decoration: none;
    }

    .account-mobile-card-name:hover,
    .account-mobile-card-name:focus-visible {
        color: var(--primary);
        text-decoration: underline;
    }

    .account-mobile-card-type-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem;
        min-width: 0;
    }

    .account-mobile-card-type {
        color: #64748b;
        font-size: 0.82rem;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .account-mobile-card-edit,
    .account-mobile-card-header-action {
        flex: 0 0 auto;
        margin: 0;
    }

    .account-mobile-card-header-action .button,
    .account-mobile-card-edit {
        min-height: 40px;
    }

    .account-mobile-card-summary-grid,
    .account-mobile-card-selected-details {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        min-width: 0;
        margin: 0;
    }

    .account-mobile-card-contact-count {
        grid-column: 1 / -1;
    }

    .account-mobile-card-field,
    .account-mobile-card-detail {
        display: grid;
        gap: 0.25rem;
        min-width: 0;
        padding: 0.65rem;
        border-radius: 13px;
        background: #f8fbff;
    }

    .account-mobile-card-field strong,
    .account-mobile-card-field a,
    .account-mobile-card-detail dd {
        min-width: 0;
        margin: 0;
        font-size: 0.88rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .account-mobile-card-selected-details:empty {
        display: none;
    }

    .account-mobile-card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        min-width: 0;
        padding-top: 0.1rem;
    }

    .account-mobile-card-actions .button,
    .account-mobile-card-actions button,
    .account-mobile-card-actions form,
    .account-mobile-card-more {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .account-mobile-card-actions .button,
    .account-mobile-card-actions button,
    .account-mobile-card-more > summary {
        display: inline-flex;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        text-align: center;
        touch-action: manipulation;
    }

    .account-mobile-card-more > summary {
        box-sizing: border-box;
        list-style: none;
    }

    .account-mobile-card-more > summary::-webkit-details-marker {
        display: none;
    }

    .account-mobile-card-more-panel {
        display: grid;
        gap: 0.45rem;
        padding-top: 0.45rem;
    }
}

@media (max-width: 420px) {
    .account-mobile-sort-form,
    .account-mobile-card-summary-grid,
    .account-mobile-card-selected-details {
        grid-template-columns: 1fr;
    }

    .account-mobile-card-contact-count {
        grid-column: auto;
    }
}


/* Stage 5 Pass 3: shared phone-first filter drawer for Contacts, Accounts, and Tasks. */
:root {
    --zxp-mobile-filter-drawer-layer: stage5-pass3;
    --zxp-mobile-filter-drawer-radius: 20px;
    --zxp-mobile-filter-drawer-backdrop: rgba(15, 23, 42, 0.52);
}

.zxp-mobile-filter-drawer {
    display: contents;
}

.zxp-mobile-filter-drawer > summary,
.zxp-mobile-search-submit,
.zxp-mobile-active-filters {
    display: none;
}

.zxp-mobile-filter-drawer > .zxp-mobile-filter-drawer-panel {
    display: contents;
}

@media (max-width: 760px) {
    body:has(.zxp-mobile-filter-drawer[open]) {
        overflow: hidden;
    }

    .zxp-list-workspace--contacts .zxp-list-filter-grid,
    .zxp-list-workspace--accounts .zxp-list-filter-grid,
    .zxp-tasks-workspace .crm-tasks-filters.zxp-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.6rem !important;
    }

    .zxp-list-workspace--contacts .zxp-list-primary-filter,
    .zxp-list-workspace--accounts .zxp-list-primary-filter,
    .zxp-tasks-workspace .crm-tasks-filters.zxp-form-grid > .form-field.grow {
        grid-column: 1 / -1 !important;
    }

    .zxp-mobile-search-submit {
        display: inline-flex;
        width: 100%;
        min-width: 0;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        margin: 0;
        touch-action: manipulation;
    }

    .zxp-mobile-filter-drawer {
        display: block;
        min-width: 0;
        margin: 0;
    }

    .zxp-mobile-filter-drawer > summary.zxp-mobile-filter-trigger {
        display: inline-flex;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        margin: 0;
        list-style: none;
        cursor: pointer;
        text-align: center;
        touch-action: manipulation;
    }

    .zxp-mobile-filter-drawer > summary.zxp-mobile-filter-trigger::-webkit-details-marker {
        display: none;
    }

    .zxp-mobile-filter-trigger-close-label {
        display: none;
    }

    .zxp-mobile-filter-count {
        display: inline-flex;
        min-height: 22px;
        align-items: center;
        justify-content: center;
        padding: 2px 7px;
        border-radius: 999px;
        background: #e0f2fe;
        color: #075985;
        font-size: 0.68rem;
        font-weight: 900;
        letter-spacing: 0.035em;
        text-transform: uppercase;
    }

    .zxp-mobile-filter-drawer > .zxp-mobile-filter-drawer-panel {
        display: none;
    }

    .zxp-mobile-filter-drawer[open] {
        position: fixed;
        inset: 0;
        z-index: 1995;
        display: flex !important;
        min-width: 0;
        flex-direction: column;
        justify-content: flex-end;
        padding: max(0.75rem, var(--zxp-mobile-safe-top, 0px)) max(0.75rem, var(--zxp-mobile-safe-right, 0px)) calc(0.75rem + var(--zxp-mobile-content-bottom-offset, 0px)) max(0.75rem, var(--zxp-mobile-safe-left, 0px));
        background: var(--zxp-mobile-filter-drawer-backdrop);
    }

    .zxp-mobile-filter-drawer[open] > summary.zxp-mobile-filter-trigger,
    .zxp-mobile-filter-drawer[open] > .zxp-mobile-filter-drawer-panel {
        width: min(100%, 620px);
        margin-inline: auto;
        background: #ffffff;
    }

    .zxp-mobile-filter-drawer[open] > summary.zxp-mobile-filter-trigger {
        flex: 0 0 auto;
        justify-content: space-between;
        padding: 0.8rem 0.9rem;
        border: 1px solid rgba(148, 163, 184, 0.34);
        border-bottom: 0;
        border-radius: var(--zxp-mobile-filter-drawer-radius) var(--zxp-mobile-filter-drawer-radius) 0 0;
        box-shadow: 0 -14px 36px rgba(15, 23, 42, 0.16);
    }

    .zxp-mobile-filter-drawer[open] .zxp-mobile-filter-trigger-label {
        display: none;
    }

    .zxp-mobile-filter-drawer[open] .zxp-mobile-filter-trigger-close-label {
        display: inline;
    }

    .zxp-mobile-filter-drawer[open] > .zxp-mobile-filter-drawer-panel {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-height: min(68dvh, 620px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0.9rem;
        border: 1px solid rgba(148, 163, 184, 0.34);
        border-top: 0;
        border-radius: 0 0 var(--zxp-mobile-filter-drawer-radius) var(--zxp-mobile-filter-drawer-radius);
        -webkit-overflow-scrolling: touch;
    }

    .zxp-mobile-filter-drawer-panel .crm-filter-field,
    .zxp-mobile-filter-drawer-panel .form-field,
    .zxp-mobile-filter-drawer-panel .crm-filter-pair,
    .zxp-mobile-filter-drawer-panel .crm-filter-actions,
    .zxp-mobile-filter-drawer-panel .crm-tasks-filter-actions {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .zxp-mobile-filter-drawer-panel .crm-filter-pair {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .zxp-mobile-filter-drawer-panel input,
    .zxp-mobile-filter-drawer-panel select,
    .zxp-mobile-filter-drawer-panel textarea {
        width: 100%;
        min-width: 0;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        font-size: 16px;
    }

    .zxp-mobile-filter-drawer-panel .zxp-list-filter-actions,
    .zxp-mobile-filter-drawer-panel .crm-tasks-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .zxp-mobile-filter-drawer-panel .zxp-list-filter-actions .button,
    .zxp-mobile-filter-drawer-panel .crm-tasks-filter-actions .button {
        display: inline-flex;
        width: 100%;
        min-width: 0;
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        margin: 0;
        text-align: center;
    }

    .zxp-mobile-active-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        min-width: 0;
        margin: -0.15rem 0 0.1rem;
    }

    .zxp-mobile-filter-chip {
        display: inline-flex;
        max-width: 100%;
        min-height: 30px;
        align-items: center;
        padding: 5px 9px;
        border: 1px solid rgba(14, 116, 144, 0.18);
        border-radius: 999px;
        background: #ecfeff;
        color: #155e75;
        font-size: 0.76rem;
        font-weight: 800;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {
    .zxp-mobile-filter-drawer-panel .zxp-list-filter-actions,
    .zxp-mobile-filter-drawer-panel .crm-tasks-filter-actions {
        grid-template-columns: 1fr;
    }
}


/* Stage 5 Pass 4: unknown caller resolution and communication follow-up. */
:root {
    --zxp-mobile-unknown-caller-layer: stage5-pass4;
}

.report-voice-follow-up-heading,
.report-voice-follow-up-cell {
    min-width: 190px;
}

.report-voice-follow-up-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    min-width: 0;
}

.report-voice-follow-up-actions form,
.call-log-mobile-resolution-form {
    min-width: 0;
    margin: 0;
}

.report-voice-follow-up-actions .button,
.report-voice-follow-up-actions button,
.call-log-mobile-resolution-form .button {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.contact-call-resolution-context[data-stage5-call-resolution="stage5-pass4"] {
    display: grid;
    gap: 0.35rem;
    border-color: rgba(14, 116, 144, 0.24);
    background: linear-gradient(135deg, #ecfeff 0%, #f8fbff 100%);
}

.contact-call-resolution-context[data-stage5-call-resolution="stage5-pass4"] strong {
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.contact-call-resolution-context[data-stage5-call-resolution="stage5-pass4"] p {
    margin: 0;
}

@media (max-width: 760px) {
    .report-voice-follow-up-heading,
    .report-voice-follow-up-cell {
        min-width: 170px;
    }

    .report-voice-follow-up-actions {
        grid-template-columns: 1fr;
    }

    .report-voice-follow-up-actions .button,
    .report-voice-follow-up-actions button,
    .call-log-mobile-resolution-form .button {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .call-log-mobile-resolution-form {
        width: 100%;
    }

    .contact-call-resolution-context[data-stage5-call-resolution="stage5-pass4"] {
        margin-bottom: 0.8rem;
        padding: 0.85rem;
    }
}


/* Stage 5 Pass 5: phone-native task queue cards using the existing task rows. */
:root {
    --zxp-mobile-task-queue-layer: stage5-pass5;
}

@media (max-width: 760px) {
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] {
        overflow: visible;
        margin-right: 0;
        margin-left: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-tasks-table,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-tasks-table tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-tasks-table thead {
        display: none;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-tasks-table tbody {
        display: grid;
        gap: 0.8rem;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        width: 100%;
        min-width: 0;
        padding: 0.8rem;
        border: 1px solid rgba(186, 217, 246, 0.92);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
        scroll-margin-top: calc(var(--zxp-mobile-content-top-offset, 0px) + 0.75rem);
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row--overdue {
        border-color: rgba(225, 29, 72, 0.24);
        box-shadow: inset 3px 0 0 rgba(225, 29, 72, 0.38), 0 12px 28px rgba(15, 23, 42, 0.07);
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row:target {
        outline: 3px solid rgba(37, 99, 235, 0.28);
        outline-offset: 2px;
        background: #ffffff;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td {
        display: grid;
        gap: 0.28rem;
        min-width: 0;
        padding: 0.62rem;
        border: 0;
        border-radius: 13px;
        background: #f8fbff;
        overflow-wrap: anywhere;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td::before {
        color: #64748b;
        font-size: 0.7rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        line-height: 1.2;
        text-transform: uppercase;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:nth-child(2)::before {
        content: "Record";
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:nth-child(3)::before {
        content: "Due";
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:nth-child(4)::before {
        content: "Priority";
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:nth-child(5)::before {
        content: "Assigned";
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:nth-child(6)::before {
        content: "Status";
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:nth-child(7)::before {
        content: "Source";
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:first-child,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:last-child {
        grid-column: 1 / -1;
        padding: 0.15rem 0;
        background: transparent;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-main-cell strong {
        font-size: 1rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-main-cell p {
        margin-top: 0.35rem;
        overflow-wrap: anywhere;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-record-links {
        min-width: 0;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-record-links a,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-record-links span,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-record-links small {
        overflow-wrap: anywhere;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-due,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .status-pill {
        width: fit-content;
        max-width: 100%;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-inline-edit {
        margin-top: 0.55rem;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-inline-edit > summary {
        display: inline-flex;
        min-height: 42px;
        align-items: center;
        justify-content: center;
        padding: 0.55rem 0.75rem;
        border: 1px solid rgba(37, 99, 235, 0.2);
        border-radius: 12px;
        background: #eff6ff;
        text-align: center;
        touch-action: manipulation;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-inline-edit-form {
        grid-template-columns: 1fr;
        margin-top: 0.55rem;
        padding: 0.7rem;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-inline-edit-form input,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-inline-edit-form select,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-inline-edit-form textarea {
        min-width: 0;
        font-size: 16px;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
        min-width: 0;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row-actions form,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row-actions .button {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row-actions .button {
        min-height: var(--zxp-mobile-communications-workflow-touch-target, 46px);
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }
}

@media (max-width: 420px) {
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row-actions {
        grid-template-columns: 1fr;
    }

    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:first-child,
    .zxp-tasks-workspace .crm-tasks-table-wrap[data-stage5-task-queue="stage5-pass5"] .crm-task-row > td:last-child {
        grid-column: auto;
    }
}


/* Stage 6 Pass 1: mobile bottom navigation foundation. */
:root {
    --zxp-mobile-bottom-navigation-layer: stage6-pass1;
    --zxp-mobile-bottom-nav-base-height: 68px;
    --zxp-mobile-bottom-nav-z-index: 1988;
}

.zxp-mobile-bottom-nav {
    display: none;
}

@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"] {
        --zxp-mobile-bottom-nav-height: var(--zxp-mobile-bottom-nav-base-height, 68px);
        --zxp-mobile-sms-composer-sticky-bottom: calc(
            var(--zxp-mobile-softphone-height, 86px)
            + var(--zxp-mobile-bottom-nav-height, 0px)
            + var(--zxp-mobile-safe-bottom, 0px)
            + 0.75rem
        );
    }

    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"] .zxp-mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: var(--zxp-mobile-bottom-nav-z-index, 1988);
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: calc(var(--zxp-mobile-bottom-nav-base-height, 68px) + var(--zxp-mobile-safe-bottom, 0px));
        padding: 4px max(6px, var(--zxp-mobile-safe-right, 0px)) var(--zxp-mobile-safe-bottom, 0px) max(6px, var(--zxp-mobile-safe-left, 0px));
        border-top: 1px solid rgba(148, 163, 184, 0.28);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.1);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .zxp-mobile-bottom-nav__slot {
        display: contents;
    }

    .zxp-mobile-bottom-nav__item {
        display: flex;
        min-width: 0;
        min-height: 60px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        padding: 6px 3px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #52647a;
        font: inherit;
        line-height: 1;
        text-align: center;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    button.zxp-mobile-bottom-nav__item {
        width: 100%;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
    }

    .zxp-mobile-bottom-nav__item:not(.is-disabled):active {
        background: #eef6ff;
        color: #0b4f93;
        transform: translateY(1px);
    }

    .zxp-mobile-bottom-nav__item:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.34);
        outline-offset: -3px;
    }

    .zxp-mobile-bottom-nav__item.is-disabled {
        opacity: 0.44;
        cursor: not-allowed;
    }

    .zxp-mobile-bottom-nav__icon {
        display: inline-flex;
        width: 23px;
        height: 23px;
        align-items: center;
        justify-content: center;
        flex: 0 0 23px;
    }

    .zxp-mobile-bottom-nav__icon svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.85;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .zxp-mobile-bottom-nav__label {
        display: block;
        width: 100%;
        overflow: hidden;
        font-size: 0.68rem;
        font-weight: 760;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-softphone-mobile-viewport [data-softphone-root] {
        bottom: calc(
            var(--zxp-mobile-safe-bottom, 0px)
            + var(--zxp-mobile-bottom-nav-height, 0px)
            + var(--zxp-mobile-softphone-edge-gap, 10px)
        );
    }
}

@media (max-width: 420px) {
    .zxp-mobile-bottom-nav__label {
        font-size: 0.64rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zxp-mobile-bottom-nav__item {
        transition: none;
    }
}

/* Stage 6 Pass 2: bottom-navigation active states, permissions, and badges. */
:root {
    --zxp-mobile-bottom-navigation-state-layer: stage6-pass2;
}

@media (max-width: 760px) {
    .zxp-mobile-bottom-nav__item {
        position: relative;
    }

    .zxp-mobile-bottom-nav__item.is-active:not(.is-disabled),
    .zxp-mobile-bottom-nav__more[aria-expanded="true"] {
        background: #eef6ff;
        color: #0b4f93;
    }

    .zxp-mobile-bottom-nav__item.is-active:not(.is-disabled) .zxp-mobile-bottom-nav__icon,
    .zxp-mobile-bottom-nav__more[aria-expanded="true"] .zxp-mobile-bottom-nav__icon {
        transform: translateY(-1px);
    }

    .zxp-mobile-bottom-nav__item.is-active:not(.is-disabled) .zxp-mobile-bottom-nav__label,
    .zxp-mobile-bottom-nav__more[aria-expanded="true"] .zxp-mobile-bottom-nav__label {
        font-weight: 850;
    }

    .zxp-mobile-bottom-nav__item.is-active:not(.is-disabled)::before,
    .zxp-mobile-bottom-nav__more[aria-expanded="true"]::before {
        position: absolute;
        top: 2px;
        left: 50%;
        width: 22px;
        height: 3px;
        border-radius: 999px;
        background: currentColor;
        content: "";
        transform: translateX(-50%);
    }

    .zxp-mobile-bottom-nav__badge {
        position: absolute;
        top: 5px;
        left: calc(50% + 7px);
        display: inline-flex;
        min-width: 18px;
        height: 18px;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        border: 2px solid rgba(255, 255, 255, 0.98);
        border-radius: 999px;
        background: #b42318;
        color: #fff;
        font-size: 0.62rem;
        font-weight: 850;
        line-height: 1;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
        pointer-events: none;
    }

    .zxp-mobile-bottom-nav__slot[data-mobile-nav-permitted="false"] .zxp-mobile-bottom-nav__item {
        color: #94a3b8;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zxp-mobile-bottom-nav__item.is-active:not(.is-disabled) .zxp-mobile-bottom-nav__icon,
    .zxp-mobile-bottom-nav__more[aria-expanded="true"] .zxp-mobile-bottom-nav__icon {
        transform: none;
    }
}

/* Stage 6 Pass 3: More navigation bottom-sheet integration. */
:root {
    --zxp-mobile-more-navigation-layer: stage6-pass3;
    --zxp-mobile-more-sheet-z-index: 1989;
}

.zxp-mobile-more-sheet {
    display: none;
}

@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-mobile-bottom-nav-ready .mobile-menu-button {
        display: none;
    }

    body.zxp-mobile-more-open {
        overflow: hidden;
    }

    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"] .zxp-mobile-more-sheet:not([hidden]) {
        position: fixed;
        top: 0;
        right: 0;
        bottom: calc(var(--zxp-mobile-bottom-nav-height, 68px) + var(--zxp-mobile-safe-bottom, 0px));
        left: 0;
        z-index: var(--zxp-mobile-more-sheet-z-index, 1989);
        display: block;
    }

    .zxp-mobile-more-sheet__backdrop {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
        background: rgba(15, 23, 42, 0.5);
        box-shadow: none;
        cursor: default;
    }

    .zxp-mobile-more-sheet__panel {
        position: absolute;
        right: max(8px, var(--zxp-mobile-safe-right, 0px));
        bottom: 8px;
        left: max(8px, var(--zxp-mobile-safe-left, 0px));
        max-height: min(72dvh, 650px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 18px;
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 22px;
        background: #fff;
        box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
        -webkit-overflow-scrolling: touch;
    }

    .zxp-mobile-more-sheet__panel:focus {
        outline: none;
    }

    .zxp-mobile-more-sheet__header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 14px;
    }

    .zxp-mobile-more-sheet__eyebrow {
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .zxp-mobile-more-sheet__title {
        margin: 2px 0 0;
        color: #0f172a;
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .zxp-mobile-more-sheet__close {
        display: inline-flex;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        flex: 0 0 42px;
        padding: 0;
        border: 1px solid #dbe5ef;
        border-radius: 13px;
        background: #f8fafc;
        color: #334155;
        font-size: 1.7rem;
        font-weight: 400;
        line-height: 1;
    }

    .zxp-mobile-more-sheet__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .zxp-mobile-more-sheet__link {
        position: relative;
        display: flex;
        min-width: 0;
        min-height: 84px;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
        border: 1px solid #dbe5ef;
        border-radius: 16px;
        background: #fff;
        color: #203047;
        text-decoration: none;
        touch-action: manipulation;
    }

    .zxp-mobile-more-sheet__link:active,
    .zxp-mobile-more-sheet__link.is-active {
        border-color: #b9d7f5;
        background: #eef6ff;
        color: #0b4f93;
    }

    .zxp-mobile-more-sheet__link.is-active::after {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: currentColor;
        content: "";
    }

    .zxp-mobile-more-sheet__link:focus-visible,
    .zxp-mobile-more-sheet__close:focus-visible,
    .zxp-mobile-more-sheet__full-menu:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.34);
        outline-offset: 2px;
    }

    .zxp-mobile-more-sheet__icon {
        display: inline-flex;
        width: 24px;
        height: 24px;
        align-items: center;
        justify-content: center;
        flex: 0 0 24px;
    }

    .zxp-mobile-more-sheet__icon svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .zxp-mobile-more-sheet__link-copy {
        display: flex;
        min-width: 0;
        flex: 1 1 auto;
        flex-direction: column;
        gap: 3px;
    }

    .zxp-mobile-more-sheet__link-copy strong {
        overflow: hidden;
        font-size: 0.84rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .zxp-mobile-more-sheet__link-copy small {
        color: #64748b;
        font-size: 0.7rem;
        line-height: 1.25;
    }

    .zxp-mobile-more-sheet__badge {
        position: absolute;
        top: 8px;
        right: 8px;
        display: inline-flex;
        min-width: 19px;
        height: 19px;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        border-radius: 999px;
        background: #b42318;
        color: #fff;
        font-size: 0.62rem;
        font-weight: 850;
        line-height: 1;
    }

    .zxp-mobile-more-sheet__link.is-active .zxp-mobile-more-sheet__badge {
        right: 21px;
    }

    .zxp-mobile-more-sheet__full-menu {
        display: flex;
        width: 100%;
        min-height: 54px;
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
        gap: 2px;
        margin-top: 12px;
        padding: 10px 13px;
        border: 1px solid #cfe2f6;
        border-radius: 15px;
        background: #f4f9ff;
        color: #17456f;
        text-align: left;
        touch-action: manipulation;
    }

    .zxp-mobile-more-sheet__full-menu span {
        font-weight: 820;
    }

    .zxp-mobile-more-sheet__full-menu small {
        color: #5c7288;
        font-size: 0.7rem;
        line-height: 1.25;
    }
}

@media (max-width: 420px) {
    .zxp-mobile-more-sheet__panel {
        right: 6px;
        bottom: 6px;
        left: 6px;
        padding: 14px;
        border-radius: 20px;
    }

    .zxp-mobile-more-sheet__grid {
        gap: 8px;
    }

    .zxp-mobile-more-sheet__link {
        min-height: 80px;
        padding: 10px;
    }

    .zxp-mobile-more-sheet__link-copy small {
        font-size: 0.66rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zxp-mobile-more-sheet__link,
    .zxp-mobile-more-sheet__close,
    .zxp-mobile-more-sheet__full-menu {
        transition: none;
    }
}

/* Stage 6 Pass 4: bottom navigation, softphone, and composer integration. */
:root {
    --zxp-mobile-navigation-integration-layer: stage6-pass4;
    --zxp-mobile-navigation-stack-gap: 8px;
    --zxp-mobile-navigation-transition-duration: 160ms;
}

@media (max-width: 760px) {
    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"] .zxp-mobile-bottom-nav {
        transition:
            transform var(--zxp-mobile-navigation-transition-duration, 160ms) ease,
            opacity var(--zxp-mobile-navigation-transition-duration, 160ms) ease,
            visibility var(--zxp-mobile-navigation-transition-duration, 160ms) ease;
    }

    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-mobile-keyboard-open,
    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-softphone-mobile-keyboard-open,
    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-mobile-navigation-input-focus {
        --zxp-mobile-bottom-nav-height: 0px;
    }

    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-mobile-keyboard-open .zxp-mobile-bottom-nav,
    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-softphone-mobile-keyboard-open .zxp-mobile-bottom-nav,
    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"].zxp-mobile-navigation-input-focus .zxp-mobile-bottom-nav {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(calc(100% + var(--zxp-mobile-safe-bottom, 0px)));
    }

    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"] .zxp-mobile-more-sheet:not([hidden]) {
        bottom: calc(
            var(--zxp-mobile-bottom-nav-height, 0px)
            + var(--zxp-mobile-safe-bottom, 0px)
            + var(--zxp-mobile-softphone-height, 0px)
            + var(--zxp-mobile-navigation-stack-gap, 8px)
        );
    }

    body[data-zxp-app-surface="workspace"][data-zxp-mobile-bottom-nav="enabled"] .zxp-mobile-more-sheet__panel {
        max-height: min(
            72dvh,
            calc(
                var(--zxp-mobile-viewport-height, 100dvh)
                - var(--zxp-mobile-safe-top, 0px)
                - var(--zxp-mobile-bottom-nav-height, 0px)
                - var(--zxp-mobile-softphone-height, 0px)
                - var(--zxp-mobile-navigation-stack-gap, 8px)
                - 28px
            )
        );
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-keyboard-open .zxp-mobile-more-sheet:not([hidden]),
    body[data-zxp-app-surface="workspace"].zxp-softphone-mobile-keyboard-open .zxp-mobile-more-sheet:not([hidden]),
    body[data-zxp-app-surface="workspace"].zxp-mobile-navigation-input-focus .zxp-mobile-more-sheet:not([hidden]) {
        display: none;
    }

    body[data-zxp-app-surface="workspace"].zxp-mobile-navigation-input-focus .sms-mobile-composer-card,
    body[data-zxp-app-surface="workspace"].zxp-mobile-navigation-input-focus [data-softphone-root] :where(input, textarea, select) {
        scroll-margin-bottom: calc(
            var(--zxp-mobile-softphone-height, 0px)
            + var(--zxp-mobile-safe-bottom, 0px)
            + 18px
        );
    }
}

@media (prefers-reduced-motion: reduce) {
    .zxp-mobile-bottom-nav {
        transition: none !important;
    }
}

/* Stage 7 Pass 3: mobile permission and capability UX. */
:root {
    --zxp-mobile-capability-ux-layer: stage7-pass3;
}

@media (max-width: 760px) {
    .zxp-mobile-capability-card {
        margin-top: 12px;
        border: 1px solid #dbe5ef;
        border-radius: 16px;
        background: #f8fafc;
        overflow: hidden;
    }

    .zxp-mobile-capability-card__toggle {
        display: flex;
        width: 100%;
        min-height: 58px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 11px 13px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #203047;
        text-align: left;
        touch-action: manipulation;
    }

    .zxp-mobile-capability-card__toggle:focus-visible,
    .zxp-mobile-capability-card__actions .button:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.34);
        outline-offset: -2px;
    }

    .zxp-mobile-capability-card__heading {
        display: inline-flex;
        min-width: 0;
        align-items: center;
        gap: 8px;
        font-size: 0.83rem;
        font-weight: 820;
    }

    .zxp-mobile-capability-card__dot {
        width: 9px;
        height: 9px;
        flex: 0 0 9px;
        border-radius: 999px;
        background: #94a3b8;
    }

    .zxp-mobile-capability-card[data-mobile-capability-status="ready"] .zxp-mobile-capability-card__dot {
        background: #16803c;
    }

    .zxp-mobile-capability-card[data-mobile-capability-status="attention"] .zxp-mobile-capability-card__dot {
        background: #b42318;
    }

    .zxp-mobile-capability-card[data-mobile-capability-status="checking"] .zxp-mobile-capability-card__dot {
        background: #b7791f;
    }

    .zxp-mobile-capability-card__summary {
        max-width: 48%;
        color: #64748b;
        font-size: 0.69rem;
        font-weight: 650;
        line-height: 1.25;
        text-align: right;
    }

    .zxp-mobile-capability-card__details {
        padding: 0 13px 13px;
        border-top: 1px solid #e2e8f0;
    }

    .zxp-mobile-capability-card__rows {
        display: grid;
        gap: 0;
    }

    .zxp-mobile-capability-row {
        display: flex;
        min-height: 44px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid #e8eef5;
        color: #475569;
        font-size: 0.75rem;
    }

    .zxp-mobile-capability-row strong {
        color: #334155;
        font-size: 0.72rem;
        text-align: right;
    }

    .zxp-mobile-capability-row[data-mobile-capability-row-status="ready"] strong {
        color: #166534;
    }

    .zxp-mobile-capability-row[data-mobile-capability-row-status="attention"] strong {
        color: #b42318;
    }

    .zxp-mobile-capability-row[data-mobile-capability-row-status="checking"] strong {
        color: #8a5a13;
    }

    .zxp-mobile-capability-row[data-mobile-capability-row-status="neutral"] strong {
        color: #64748b;
    }

    .zxp-mobile-capability-card__note {
        margin: 11px 0 0;
        color: #64748b;
        font-size: 0.68rem;
        line-height: 1.4;
    }

    .zxp-mobile-capability-card__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 11px;
    }

    .zxp-mobile-capability-card__actions .button {
        min-height: 42px;
        margin: 0;
    }
}

@media (max-width: 420px) {
    .zxp-mobile-capability-card__toggle {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .zxp-mobile-capability-card__summary {
        max-width: none;
        padding-left: 17px;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zxp-mobile-capability-card__toggle,
    .zxp-mobile-capability-card__actions .button {
        transition: none;
    }
}

/* Stage 8 Pass 1: billing and core settings mobile hardening. */
:root {
    --zxp-mobile-secondary-surface-layer: stage8-pass1;
}

@media (max-width: 760px) {
    .zxp-mobile-secondary-surface {
        min-width: 0;
    }

    .zxp-mobile-billing-surface .page-header-row,
    .zxp-mobile-billing-plan-surface .page-header-row,
    .zxp-mobile-settings-surface .page-header-row {
        gap: 12px;
        margin-bottom: 18px;
    }

    .zxp-mobile-billing-surface .page-header-row > .form-actions,
    .zxp-mobile-billing-surface .page-header-row > .form-actions form,
    .zxp-mobile-billing-plan-surface .page-header-row > .button {
        width: 100%;
    }

    .zxp-mobile-billing-surface .page-header-row > .form-actions form .button,
    .zxp-mobile-billing-surface .page-header-row > .form-actions > .button,
    .zxp-mobile-billing-plan-surface .page-header-row > .button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .zxp-mobile-billing-surface [data-mobile-billing-stats] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .zxp-mobile-billing-surface [data-mobile-billing-stats] .stat {
        min-height: 100px;
        padding: 14px;
        border-radius: 16px;
    }

    .zxp-mobile-billing-surface [data-mobile-billing-stats] .stat h3 {
        margin-bottom: 7px;
        font-size: 0.67rem;
        line-height: 1.25;
    }

    .zxp-mobile-billing-surface [data-mobile-billing-stats] .stat strong {
        font-size: clamp(1.05rem, 5.5vw, 1.42rem);
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .zxp-mobile-billing-surface .mini-metric-list > div,
    .zxp-mobile-billing-plan-surface .mini-metric-list > div {
        align-items: flex-start;
        gap: 12px;
    }

    .zxp-mobile-billing-surface .mini-metric-list > div > strong,
    .zxp-mobile-billing-plan-surface .mini-metric-list > div > strong {
        max-width: 58%;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .zxp-mobile-billing-surface .wrap-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .zxp-mobile-billing-surface .wrap-actions > button,
    .zxp-mobile-billing-surface .wrap-actions > .button {
        width: 100%;
        margin: 0;
    }

    .zxp-mobile-secondary-table,
    .zxp-mobile-secondary-table tbody {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }

    .zxp-mobile-secondary-table thead {
        display: none;
    }

    .zxp-mobile-secondary-table tbody tr[data-mobile-secondary-record] {
        display: grid;
        width: 100%;
        margin: 0 0 12px;
        padding: 6px 12px;
        border: 1px solid #dbe5ef;
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    }

    .zxp-mobile-secondary-table tbody tr[data-mobile-secondary-record] > td {
        display: grid;
        grid-template-columns: minmax(88px, 0.78fr) minmax(0, 1.22fr);
        align-items: start;
        gap: 12px;
        width: 100%;
        min-width: 0;
        padding: 10px 0;
        border: 0;
        border-bottom: 1px solid #edf2f7;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .zxp-mobile-secondary-table tbody tr[data-mobile-secondary-record] > td:last-child {
        border-bottom: 0;
    }

    .zxp-mobile-secondary-table tbody tr[data-mobile-secondary-record] > td::before {
        content: attr(data-mobile-label);
        color: #64748b;
        font-size: 0.7rem;
        font-weight: 800;
        line-height: 1.35;
        letter-spacing: 0.025em;
        text-transform: uppercase;
    }

    .zxp-mobile-secondary-table .status-pill {
        justify-self: start;
        max-width: 100%;
        white-space: normal;
    }

    .zxp-mobile-table-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .zxp-mobile-table-actions form,
    .zxp-mobile-table-actions .button,
    .zxp-mobile-table-actions button {
        width: 100%;
        margin: 0;
    }

    .zxp-mobile-secondary-table .zxp-mobile-secondary-table-empty {
        display: block;
        width: 100%;
    }

    .zxp-mobile-secondary-table .zxp-mobile-secondary-table-empty > td {
        display: block;
        width: 100%;
        padding: 14px 0;
        border: 0;
        text-align: left;
        white-space: normal;
    }

    .zxp-mobile-secondary-table .zxp-mobile-secondary-table-empty > td::before {
        content: none;
    }

    .zxp-mobile-settings-form > h2 {
        margin-top: 28px;
        padding-top: 22px;
        border-top: 1px solid #e2e8f0;
    }

    .zxp-mobile-settings-form > h2:first-child {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .zxp-mobile-settings-form > h3 {
        margin-top: 22px;
    }

    .zxp-mobile-settings-form .checkbox-line {
        display: flex;
        min-height: 48px;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #f8fafc;
        line-height: 1.4;
    }

    .zxp-mobile-settings-form .checkbox-line input[type="checkbox"] {
        width: auto;
        min-height: 0;
        flex: 0 0 auto;
        margin: 3px 0 0;
    }

    .zxp-mobile-settings-form [data-mobile-settings-primary-action] {
        width: 100%;
        margin-top: 24px;
    }
}

@media (max-width: 360px) {
    .zxp-mobile-billing-surface [data-mobile-billing-stats] {
        grid-template-columns: 1fr;
    }

    .zxp-mobile-secondary-table tbody tr[data-mobile-secondary-record] > td {
        grid-template-columns: minmax(78px, 0.72fr) minmax(0, 1.28fr);
        gap: 10px;
    }
}

