/* Native APK / Capacitor: always use the phone layout, never desktop CSS width. */
html.edoor-native,
html.capacitor-native {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html.edoor-native body,
html.capacitor-native body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    font-family: var(--edoor-font-sans, "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif) !important;
}

/* Force mobile chrome even if WebView reports a wide CSS pixel width. */
html.edoor-native .layout-sidebar,
html.capacitor-native .layout-sidebar {
    transform: translateX(-100%);
    width: min(86vw, 320px) !important;
    max-width: min(86vw, 320px) !important;
    left: 0;
    right: auto;
    border-radius: 0 22px 22px 0;
}

html.edoor-native body.sidebar-open .layout-sidebar,
html.capacitor-native body.sidebar-open .layout-sidebar {
    transform: translateX(0);
}

html.edoor-native body.sidebar-open,
html.capacitor-native body.sidebar-open,
html.edoor-native.edoor-sidebar-scroll-lock,
html.capacitor-native.edoor-sidebar-scroll-lock {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

html.edoor-native body.sidebar-open,
html.capacitor-native body.sidebar-open,
html.edoor-native body.edoor-sidebar-scroll-lock,
html.capacitor-native body.edoor-sidebar-scroll-lock {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

html.edoor-native body.edoor-sidebar-scroll-lock,
html.capacitor-native body.edoor-sidebar-scroll-lock {
    position: fixed !important;
    width: 100% !important;
    left: 0;
    right: 0;
}

html.edoor-native body.sidebar-open .layout-main,
html.edoor-native body.sidebar-open .content-wrapper,
html.capacitor-native body.sidebar-open .layout-main,
html.capacitor-native body.sidebar-open .content-wrapper {
    overflow: hidden !important;
    touch-action: none;
}

html.edoor-native body.sidebar-open .layout-sidebar .sidebar-menu,
html.capacitor-native body.sidebar-open .layout-sidebar .sidebar-menu {
    touch-action: pan-y;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

html.edoor-native body.sidebar-open .sidebar-overlay,
html.capacitor-native body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
    touch-action: none;
}

html.edoor-native .layout-main,
html.capacitor-native .layout-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
}

html.edoor-native .mobile-toggle,
html.capacitor-native .mobile-toggle {
    display: inline-flex !important;
}

html.edoor-native .user-meta,
html.capacitor-native .user-meta {
    display: none !important;
}

html.edoor-native .layout-header,
html.edoor-native .content-wrapper,
html.capacitor-native .layout-header,
html.capacitor-native .content-wrapper {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

html.edoor-native .layout-header,
html.capacitor-native .layout-header {
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px)) !important;
}

html.edoor-native .content-wrapper,
html.capacitor-native .content-wrapper {
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px)) !important;
    overflow-x: hidden !important;
}

html.edoor-native .chat-app-container,
html.edoor-native .chat-support-page .chat-app-container,
html.capacitor-native .chat-app-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/* Native WebView must always use chat's single-column phone layout even on
   devices/WebView versions that report a desktop-like CSS viewport. */
html.edoor-native body.chat-support-page .chat-app-container,
html.capacitor-native body.chat-support-page .chat-app-container {
    position: relative !important;
    max-height: var(--edoor-visual-height, 100dvh) !important;
}

html.edoor-native body.chat-support-page .layout-main,
html.capacitor-native body.chat-support-page .layout-main {
    height: var(--edoor-visual-height, 100dvh) !important;
    max-height: var(--edoor-visual-height, 100dvh) !important;
}

html.edoor-native body.chat-support-page .chat-sidebar,
html.capacitor-native body.chat-support-page .chat-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    border-right: 0 !important;
}

html.edoor-native body.chat-support-page .chat-main,
html.capacitor-native body.chat-support-page .chat-main {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    transform: translateX(100%);
}

html.edoor-native body.chat-support-page .chat-main.active,
html.capacitor-native body.chat-support-page .chat-main.active {
    transform: translateX(0);
}

html.edoor-native body.chat-support-page .chat-input-area,
html.capacitor-native body.chat-support-page .chat-input-area {
    position: relative !important;
    z-index: 4;
    flex: 0 0 auto !important;
}

html.edoor-keyboard-open body.chat-support-page .chat-input-area {
    padding-bottom: 8px !important;
}

html.edoor-native img,
html.edoor-native video,
html.edoor-native iframe,
html.edoor-native table,
html.edoor-native .container,
html.edoor-native .container-fluid,
html.capacitor-native img,
html.capacitor-native video,
html.capacitor-native iframe,
html.capacitor-native table,
html.capacitor-native .container,
html.capacitor-native .container-fluid {
    max-width: 100%;
}

html.edoor-native .table-responsive,
html.capacitor-native .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Shared APK safety net for every authenticated Razor view. */
html.edoor-native .content-wrapper > *,
html.capacitor-native .content-wrapper > *,
html.edoor-native .row > *,
html.capacitor-native .row > * {
    min-width: 0;
    max-width: 100%;
}

html.edoor-native .content-wrapper .card,
html.edoor-native .content-wrapper form,
html.edoor-native .content-wrapper fieldset,
html.edoor-native .content-wrapper .modal-content,
html.capacitor-native .content-wrapper .card,
html.capacitor-native .content-wrapper form,
html.capacitor-native .content-wrapper fieldset,
html.capacitor-native .content-wrapper .modal-content {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

html.edoor-native .content-wrapper input,
html.edoor-native .content-wrapper select,
html.edoor-native .content-wrapper textarea,
html.capacitor-native .content-wrapper input,
html.capacitor-native .content-wrapper select,
html.capacitor-native .content-wrapper textarea {
    max-width: 100%;
    min-width: 0;
}

html.edoor-native .content-wrapper .nav,
html.edoor-native .content-wrapper .nav-tabs,
html.capacitor-native .content-wrapper .nav,
html.capacitor-native .content-wrapper .nav-tabs {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}

html.edoor-native .modal-dialog,
html.capacitor-native .modal-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 12px auto;
}

/* Keep icon glyphs in a stable box so ligature text cannot stretch the nav. */
html.edoor-native .material-icons-outlined,
html.edoor-native .material-icons,
html.capacitor-native .material-icons-outlined,
html.capacitor-native .material-icons {
    font-family: 'Material Icons Outlined', 'Material Icons' !important;
    font-feature-settings: 'liga' 1;
    -webkit-font-feature-settings: 'liga' 1;
    overflow: hidden;
    text-align: center;
    flex-shrink: 0;
}

html.edoor-native .nav-icon,
html.capacitor-native .nav-icon {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    overflow: hidden;
    flex-shrink: 0;
}

html.edoor-native .nav-link-custom,
html.capacitor-native .nav-link-custom {
    min-width: 0;
}

html.edoor-native .auth-root,
html.edoor-native .auth-shell,
html.edoor-native .auth-card,
html.edoor-native .auth-panel {
    max-width: 100%;
    min-width: 0;
}

html.edoor-native .auth-root {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

html.edoor-native .onesignal-grid,
html.capacitor-native .onesignal-grid {
    grid-template-columns: 1fr !important;
}

html.edoor-native .notification-dropdown .notification-list,
html.capacitor-native .notification-dropdown .notification-list {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 58px) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    margin: 0 !important;
    max-height: min(420px, calc(100dvh - env(safe-area-inset-top, 0px) - 72px));
}

html.edoor-native .edoor-cf-overlay,
html.capacitor-native .edoor-cf-overlay {
    padding: 0 !important;
    align-items: stretch !important;
}

html.edoor-native .edoor-cf-shell,
html.capacitor-native .edoor-cf-shell {
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
}

html.edoor-native .edoor-cf-frame,
html.capacitor-native .edoor-cf-frame {
    position: relative !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

html.edoor-native .edoor-cf-frame iframe,
html.capacitor-native .edoor-cf-frame iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
}

html.edoor-native body:not(.chat-support-page):not(.edoor-incoming-call-active):not(.edoor-video-call-active):not(.edoor-rating-modal-active) .rt-floating-language-toggle,
html.capacitor-native body:not(.chat-support-page):not(.edoor-incoming-call-active):not(.edoor-video-call-active):not(.edoor-rating-modal-active) .rt-floating-language-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 1060 !important;
    touch-action: manipulation;
}

@media (max-width: 767.98px) {
    html.edoor-native .rt-floating-language-toggle,
    html.capacitor-native .rt-floating-language-toggle {
        left: auto !important;
        right: max(10px, env(safe-area-inset-right, 0px)) !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        max-width: calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    }

    html.edoor-native body.symptom-sheet-open .rt-floating-language-toggle,
    html.capacitor-native body.symptom-sheet-open .rt-floating-language-toggle {
        top: calc(env(safe-area-inset-top, 0px) + 62px) !important;
        transform: none !important;
    }
}
