/*
|--------------------------------------------------------------------------
| TanksConnected Mobile/App Layer
|--------------------------------------------------------------------------
| Clean mobile + installed-PWA styling.
| Desktop/base styling stays in tanksconnected.css.
|--------------------------------------------------------------------------
*/

:root {
    --tc-app-bg: #020617;
    --tc-app-panel: rgba(8, 15, 35, 0.96);
    --tc-app-panel-strong: rgba(15, 23, 42, 0.98);
    --tc-app-border: rgba(125, 211, 252, 0.24);
    --tc-app-text: #e5f3ff;
    --tc-app-muted: #9fb8d8;
    --tc-app-cyan: #38bdf8;
    --tc-app-blue: #0ea5e9;
    --tc-app-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
    --tc-app-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Installed PWA/app mode */
@media (display-mode: standalone) {
    html,
    body {
        overscroll-behavior-y: contain;
        background: var(--tc-app-bg);
    }

    body {
        min-height: 100dvh;
    }

    .tc-pwa-install {
        display: none !important;
    }
}

/* Global mobile breathing room */
@media (max-width: 991.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        background: var(--tc-app-bg);
        -webkit-tap-highlight-color: transparent;
    }

    main,
    .tc-main,
    .tc-content,
    .container,
    .container-fluid {
        max-width: 100%;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }
}

/* Main mobile dropdown menu */
@media (max-width: 991.98px) {
    .tc-mobile-menu {
        position: fixed !important;
        top: 86px !important;
        left: 12px !important;
        right: 12px !important;
        z-index: 99999 !important;
        display: none;
        max-height: calc(100dvh - 108px) !important;
        overflow: hidden !important;
        background:
            radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 18rem),
            var(--tc-app-panel-strong) !important;
        border: 1px solid var(--tc-app-border) !important;
        border-radius: 22px !important;
        box-shadow: var(--tc-app-shadow) !important;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .tc-mobile-menu.open {
        display: block !important;
    }

    .tc-mobile-menu-inner {
        max-height: calc(100dvh - 112px) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        background: transparent !important;
        padding: 10px 0 calc(12px + var(--tc-app-safe-bottom)) !important;
    }

    .tc-mobile-link {
        display: flex !important;
        align-items: center !important;
        min-height: 46px !important;
        padding: 10px 22px !important;
        color: #f8fafc !important;
        font-size: 1rem !important;
        font-weight: 750;
        text-decoration: none !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
    }

    .tc-mobile-link:last-child {
        border-bottom: 0 !important;
    }

    .tc-mobile-link:hover,
    .tc-mobile-link:focus {
        color: #ffffff !important;
        background: rgba(56, 189, 248, 0.12) !important;
    }

    .tc-mobile-menu-backdrop {
        display: none;
        position: fixed !important;
        inset: 0 !important;
        z-index: 99990 !important;
        border: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        background: rgba(2, 6, 23, .62) !important;
        backdrop-filter: blur(5px) !important;
        -webkit-backdrop-filter: blur(5px) !important;
    }

    .tc-mobile-menu-backdrop.open {
        display: block !important;
    }

    html.tc-mobile-menu-is-open,
    body.tc-mobile-menu-is-open {
        overflow: hidden !important;
        overscroll-behavior: none !important;
        touch-action: none !important;
    }

    body.tc-mobile-menu-is-open {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }

    body.tc-mobile-menu-is-open .tc-header {
        z-index: 100000 !important;
    }
}

@media (min-width: 992px) {
    .tc-mobile-menu-backdrop {
        display: none !important;
    }
}

/* PWA install prompt */
.tc-pwa-install {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 99998;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 14px;
    border: 1px solid var(--tc-app-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 18rem),
        linear-gradient(145deg, rgba(8, 15, 35, 0.97), rgba(15, 23, 42, 0.97));
    color: var(--tc-app-text);
    box-shadow: var(--tc-app-shadow), 0 0 34px rgba(56, 189, 248, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: translateY(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
}

.tc-pwa-install--show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.tc-pwa-install__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.22);
    overflow: hidden;
    flex: 0 0 auto;
}

.tc-pwa-install__icon img {
    width: 38px;
    height: 38px;
    display: block;
}

.tc-pwa-install__copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.tc-pwa-install__copy strong {
    color: #f8fafc;
    font-size: 0.98rem;
    line-height: 1.15;
}

.tc-pwa-install__copy span {
    color: #a8c3d8;
    font-size: 0.86rem;
    line-height: 1.35;
}

.tc-pwa-install__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-pwa-install__btn {
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 999px;
    min-height: 38px;
    padding: 8px 13px;
    font-weight: 800;
    font-size: 0.86rem;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}

.tc-pwa-install__btn--primary {
    background: linear-gradient(135deg, var(--tc-app-blue), var(--tc-app-cyan));
    color: #020617;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.22);
}

.tc-pwa-install__btn--ghost {
    background: rgba(15, 23, 42, 0.42);
    color: #c7dff0;
}

.tc-pwa-install__btn:hover {
    filter: brightness(1.07);
}

@media (max-width: 640px) {
    .tc-pwa-install {
        left: 12px;
        right: 12px;
        bottom: calc(12px + var(--tc-app-safe-bottom));
        grid-template-columns: auto minmax(0, 1fr);
        gap: 11px;
        padding: 12px;
        border-radius: 20px;
    }

    .tc-pwa-install__icon {
        width: 44px;
        height: 44px;
        border-radius: 15px;
    }

    .tc-pwa-install__icon img {
        width: 34px;
        height: 34px;
    }

    .tc-pwa-install__copy strong {
        font-size: 0.95rem;
    }

    .tc-pwa-install__copy span {
        font-size: 0.8rem;
    }

    .tc-pwa-install__actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .tc-pwa-install__btn {
        flex: 1;
        min-height: 40px;
    }
}

/*
|--------------------------------------------------------------------------
| Mobile/PWA scroll safety
|--------------------------------------------------------------------------
| Installed app mode must always be allowed to page-scroll normally.
| Avoid old heavy menu scroll-lock behaviour causing stuck pages.
|--------------------------------------------------------------------------
*/

@media (max-width: 991.98px) {
    html,
    body {
        height: auto !important;
        min-height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y !important;
    }

    body {
        position: static !important;
    }

    html.tc-mobile-menu-is-open,
    body.tc-mobile-menu-is-open {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        touch-action: pan-y !important;
        overscroll-behavior-y: contain !important;
    }

    body.tc-mobile-menu-is-open {
        position: static !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
    }

    .tc-mobile-menu.open {
        overscroll-behavior: contain !important;
    }

    .tc-mobile-menu.open .tc-mobile-menu-inner {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (display-mode: standalone) {
    html,
    body {
        height: auto !important;
        min-height: 100% !important;
        overflow-y: auto !important;
        touch-action: pan-y !important;
        overscroll-behavior-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body {
        position: static !important;
    }
}


/*
|--------------------------------------------------------------------------
| Dashboard Mobile/App Layer
|--------------------------------------------------------------------------
| Clean replacement for the old inline dashboard mobile drawer/bottom-bar CSS.
|--------------------------------------------------------------------------
*/

.tc-dashboard-mobile-topbar,
.tc-dashboard-mobile-bottombar,
.tc-dashboard-mobile-overlay,
.tc-dashboard-mobile-drawer,
.tc-dashboard-mobile-drawer-close,
.tc-dashboard-mobile-drawer-title {
    display: none;
}

@media (max-width: 900px) {
    body:has(.tc-dashboard-mobile-bottombar) {
        padding-bottom: calc(5.8rem + var(--tc-app-safe-bottom)) !important;
    }

    .tc-dashboard-mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 9000;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        margin: -.35rem -.25rem .9rem;
        padding: .7rem .8rem;
        border: 1px solid rgba(125, 211, 252, .22);
        border-radius: 0 0 22px 22px;
        background:
            radial-gradient(circle at top left, rgba(56, 189, 248, .16), transparent 16rem),
            rgba(2, 6, 23, .94);
        box-shadow: 0 14px 36px rgba(0, 0, 0, .32);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .tc-dashboard-mobile-topbar > div {
        min-width: 0;
        display: grid;
        gap: .05rem;
    }

    .tc-dashboard-mobile-eyebrow {
        color: #7dd3fc;
        font-size: .68rem;
        font-weight: 900;
        letter-spacing: .08em;
        text-transform: uppercase;
        line-height: 1;
    }

    .tc-dashboard-mobile-topbar strong {
        color: #f8fafc;
        font-size: 1rem;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tc-dashboard-mobile-topbar-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 16px;
        border: 1px solid rgba(125, 211, 252, .26);
        background: rgba(15, 23, 42, .78);
        color: #e0f2fe;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
    }

    .tc-dashboard-mobile-bottombar {
        position: fixed;
        left: .55rem;
        right: .55rem;
        bottom: calc(.55rem + var(--tc-app-safe-bottom));
        z-index: 9300;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .38rem;
        padding: .45rem;
        border: 1px solid rgba(125, 211, 252, .24);
        border-radius: 24px;
        background:
            radial-gradient(circle at top left, rgba(56, 189, 248, .16), transparent 16rem),
            rgba(2, 6, 23, .94);
        box-shadow: 0 18px 52px rgba(0, 0, 0, .42);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .tc-dashboard-mobile-bottombar button,
    .tc-dashboard-mobile-bottombar a {
        min-width: 0;
        min-height: 48px;
        border: 1px solid transparent;
        border-radius: 18px;
        background: transparent;
        color: #b7d8f2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .12rem;
        font-size: .72rem;
        font-weight: 850;
        line-height: 1.05;
        text-decoration: none;
        cursor: pointer;
    }

    .tc-dashboard-mobile-bottombar button:hover,
    .tc-dashboard-mobile-bottombar button:focus,
    .tc-dashboard-mobile-bottombar a:hover,
    .tc-dashboard-mobile-bottombar a:focus {
        color: #ffffff;
        background: rgba(56, 189, 248, .12);
        border-color: rgba(125, 211, 252, .22);
    }

    .tc-dashboard-mobile-bottombar button span,
    .tc-dashboard-mobile-bottombar a span {
        font-size: 1.1rem;
        line-height: 1;
    }

    .tc-dashboard-mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 9400;
        display: none;
        background: rgba(2, 6, 23, .68);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .tc-dashboard-mobile-overlay.is-open {
        display: block !important;
    }

    body.tc-dashboard-actions-open,
    body.tc-dashboard-summary-open {
        overflow: hidden !important;
        touch-action: none !important;
    }

    .tc-dashboard-mobile-drawer {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        z-index: 9500 !important;
        display: none;
        max-height: min(82dvh, 720px);
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 3.4rem .9rem calc(6.5rem + var(--tc-app-safe-bottom)) !important;
        margin: 0 !important;
        border-radius: 28px 28px 0 0;
        border: 1px solid rgba(125, 211, 252, .28);
        border-bottom: 0;
        background:
            radial-gradient(circle at top left, rgba(56, 189, 248, .14), transparent 20rem),
            linear-gradient(180deg, rgba(15, 23, 42, .99), rgba(2, 6, 23, .995));
        box-shadow: 0 -24px 80px rgba(0, 0, 0, .56);
        color: #e5f3ff;
        transform: translateY(105%);
        transition: transform 220ms ease;
    }

    body.tc-dashboard-actions-open .tc-dashboard-actions-drawer,
    body.tc-dashboard-summary-open .tc-dashboard-summary-drawer {
        display: block !important;
        transform: translateY(0);
    }

    .tc-dashboard-mobile-drawer-close {
        position: absolute;
        top: .75rem;
        right: .85rem;
        z-index: 2;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 16px;
        border: 1px solid rgba(125, 211, 252, .28);
        background: rgba(15, 23, 42, .82);
        color: #f8fafc;
        font-size: 1.35rem;
        line-height: 1;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
    }

    .tc-dashboard-mobile-drawer-title {
        position: absolute;
        top: 1rem;
        left: 1rem;
        right: 4.2rem;
        z-index: 2;
        display: block !important;
        color: #f8fafc;
        font-size: .95rem;
        font-weight: 950;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tc-dashboard-mobile-drawer .tc-card,
    .tc-dashboard-mobile-drawer .tc-tanks-hero-pill,
    .tc-dashboard-mobile-drawer [class*="card"] {
        background: rgba(8, 15, 35, .82) !important;
        border: 1px solid rgba(125, 211, 252, .18) !important;
        border-radius: 20px !important;
        color: #e5f3ff !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, .24) !important;
    }

    .tc-dashboard-mobile-drawer,
    .tc-dashboard-mobile-drawer * {
        color-scheme: dark;
    }

    .tc-dashboard-mobile-drawer .text-muted,
    .tc-dashboard-mobile-drawer .text-secondary,
    .tc-dashboard-mobile-drawer p,
    .tc-dashboard-mobile-drawer small,
    .tc-dashboard-mobile-drawer .small {
        color: #a8c3d8 !important;
    }

    .tc-dashboard-mobile-drawer strong,
    .tc-dashboard-mobile-drawer h1,
    .tc-dashboard-mobile-drawer h2,
    .tc-dashboard-mobile-drawer h3,
    .tc-dashboard-mobile-drawer h4,
    .tc-dashboard-mobile-drawer .fw-semibold {
        color: #f8fafc !important;
    }

    .tc-dashboard-actions-drawer {
        row-gap: .75rem !important;
    }

    .tc-dashboard-actions-drawer > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: .75rem !important;
    }

    .tc-dashboard-summary-drawer .tc-tanks-hero-pill {
        margin-bottom: .7rem !important;
        padding: .9rem !important;
    }
}

@media (max-width: 520px) {
    .tc-dashboard-mobile-topbar {
        margin-left: -.5rem;
        margin-right: -.5rem;
        padding: .62rem .68rem;
    }

    .tc-dashboard-mobile-bottombar {
        left: .35rem;
        right: .35rem;
        bottom: calc(.35rem + var(--tc-app-safe-bottom));
        gap: .24rem;
        padding: .34rem;
        border-radius: 20px;
    }

    .tc-dashboard-mobile-bottombar button,
    .tc-dashboard-mobile-bottombar a {
        min-height: 44px;
        border-radius: 15px;
        font-size: .65rem;
    }

    .tc-dashboard-mobile-drawer {
        max-height: 84dvh;
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }
}


/*
|--------------------------------------------------------------------------
| Global Mobile App Navigation
|--------------------------------------------------------------------------
| One-handed app-style navigation for mobile browser + installed PWA users.
|--------------------------------------------------------------------------
*/

.tc-global-mobile-nav {
    display: none;
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(5.7rem + var(--tc-app-safe-bottom)) !important;
    }

    .tc-global-mobile-nav {
        position: fixed;
        left: .55rem;
        right: .55rem;
        bottom: calc(.55rem + var(--tc-app-safe-bottom));
        z-index: 9200;
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: .35rem;
        padding: .42rem;
        border: 1px solid rgba(125, 211, 252, .24);
        border-radius: 24px;
        background:
            radial-gradient(circle at top left, rgba(56, 189, 248, .16), transparent 16rem),
            rgba(2, 6, 23, .94);
        box-shadow: 0 18px 52px rgba(0, 0, 0, .42), 0 0 28px rgba(56, 189, 248, .1);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .tc-global-mobile-nav__item {
        min-width: 0;
        min-height: 48px;
        border: 1px solid transparent;
        border-radius: 18px;
        background: transparent;
        color: #b7d8f2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .12rem;
        font-size: .72rem;
        font-weight: 850;
        line-height: 1.05;
        text-decoration: none;
        cursor: pointer;
        padding: .25rem .12rem;
        appearance: none;
        -webkit-appearance: none;
    }

    .tc-global-mobile-nav__item span {
        display: block;
        font-size: 1.08rem;
        line-height: 1;
    }

    .tc-global-mobile-nav__item small {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .66rem;
        line-height: 1.05;
    }

    .tc-global-mobile-nav__item:hover,
    .tc-global-mobile-nav__item:focus,
    .tc-global-mobile-nav__item.is-active {
        color: #ffffff;
        background: linear-gradient(135deg, rgba(14, 165, 233, .26), rgba(37, 99, 235, .18));
        border-color: rgba(125, 211, 252, .28);
        outline: none;
    }

    .tc-global-mobile-nav__item.is-active {
        box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .12), 0 0 18px rgba(56, 189, 248, .16);
    }

    /*
     * Dashboard had its own old nav bar. The global bar replaces it.
     * Keep dashboard drawers/topbar available; only remove the duplicated bottom navigation.
     */
    .tc-dashboard-mobile-bottombar {
        display: none !important;
    }

    /*
     * Chat has its own input bar/cockpit. Do not overlay global nav there.
     */
    body.tc-page-chat .tc-global-mobile-nav,
    body:has(.tc-chat-page) .tc-global-mobile-nav {
        display: none !important;
    }

    body.tc-page-chat,
    body:has(.tc-chat-page) {
        padding-bottom: 0 !important;
    }
}

@media (max-width: 420px) {
    .tc-global-mobile-nav {
        left: .35rem;
        right: .35rem;
        bottom: calc(.35rem + var(--tc-app-safe-bottom));
        gap: .22rem;
        padding: .32rem;
        border-radius: 20px;
    }

    .tc-global-mobile-nav__item {
        min-height: 44px;
        border-radius: 15px;
        font-size: .66rem;
    }

    .tc-global-mobile-nav__item span {
        font-size: 1rem;
    }

    .tc-global-mobile-nav__item small {
        font-size: .58rem;
    }
}

@media (display-mode: standalone) and (max-width: 991.98px) {
    .tc-global-mobile-nav {
        bottom: calc(.45rem + var(--tc-app-safe-bottom));
    }
}


/*
|--------------------------------------------------------------------------
| Global nav fixes: chat + logged-in app pages
|--------------------------------------------------------------------------
| Chat has its own cockpit/input bar. Never reserve global-nav space there.
|--------------------------------------------------------------------------
*/

@media (max-width: 991.98px) {
    body.tc-page-chat {
        padding-bottom: 0 !important;
        overflow: hidden !important;
    }

    body.tc-page-chat .tc-global-mobile-nav {
        display: none !important;
    }

    body.tc-page-chat .tc-chat-page,
    body.tc-page-chat .tc-chat-shell,
    body.tc-page-chat .tc-chat-main {
        max-height: 100dvh !important;
    }

    body.tc-page-chat #tc-chat-form,
    body.tc-page-chat .tc-chat-input,
    body.tc-page-chat .tc-chat-composer {
        z-index: 9600 !important;
    }
}


/*
|--------------------------------------------------------------------------
| Dashboard drawer hard-hide fix
|--------------------------------------------------------------------------
| The old dashboard mobile drawers must not sit visible at the bottom of the
| page unless explicitly opened by the dashboard JS.
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {
    body:not(.tc-dashboard-actions-open) .tc-dashboard-actions-drawer,
    body:not(.tc-dashboard-summary-open) .tc-dashboard-summary-drawer {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
        transform: translateY(110%) !important;
    }

    body.tc-dashboard-actions-open .tc-dashboard-actions-drawer,
    body.tc-dashboard-summary-open .tc-dashboard-summary-drawer {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .tc-dashboard-mobile-drawer-close,
    .tc-dashboard-mobile-drawer-title {
        display: none !important;
    }

    body.tc-dashboard-actions-open .tc-dashboard-actions-drawer .tc-dashboard-mobile-drawer-close,
    body.tc-dashboard-actions-open .tc-dashboard-actions-drawer .tc-dashboard-mobile-drawer-title,
    body.tc-dashboard-summary-open .tc-dashboard-summary-drawer .tc-dashboard-mobile-drawer-close,
    body.tc-dashboard-summary-open .tc-dashboard-summary-drawer .tc-dashboard-mobile-drawer-title {
        display: inline-flex !important;
    }

    body.tc-dashboard-actions-open .tc-dashboard-actions-drawer .tc-dashboard-mobile-drawer-title,
    body.tc-dashboard-summary-open .tc-dashboard-summary-drawer .tc-dashboard-mobile-drawer-title {
        display: block !important;
    }

    /* The new global nav owns bottom navigation now. */
    .tc-dashboard-mobile-bottombar {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}


/*
|--------------------------------------------------------------------------
| Chat installed-PWA input fix
|--------------------------------------------------------------------------
| Android installed PWA viewport can place the chat composer below the visible
| screen. Browser mobile view is left alone; this applies only in standalone app.
|--------------------------------------------------------------------------
*/

@media (display-mode: standalone) and (max-width: 900px) {
    body.tc-page-chat,
    body.tc-page-chat html {
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    body.tc-page-chat .tc-global-mobile-nav {
        display: none !important;
    }

    body.tc-page-chat .tc-chat-page {
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    body.tc-page-chat .tc-chat-main {
        height: calc(100dvh - 4.3rem) !important;
        max-height: calc(100dvh - 4.3rem) !important;
        overflow: hidden !important;
        padding-bottom: 5.9rem !important;
    }

    body.tc-page-chat .tc-chat-messages,
    body.tc-page-chat #tc-chat-messages,
    body.tc-page-chat .tc-chat-log {
        max-height: calc(100dvh - 14rem) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 7.2rem !important;
        scroll-padding-bottom: 7.2rem !important;
    }

    body.tc-page-chat #tc-chat-form {
        position: fixed !important;
        left: .55rem !important;
        right: .55rem !important;
        bottom: calc(.55rem + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 9800 !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        transform: none !important;
    }

    body.tc-page-chat #tc-chat-form input,
    body.tc-page-chat #tc-chat-form textarea {
        min-height: 42px !important;
        max-height: 86px !important;
    }

    body.tc-page-chat .tc-mobile-chat-users-btn,
    body.tc-page-chat #tcMobileChatUsersToggle {
        z-index: 9900 !important;
    }
}

@media (display-mode: standalone) and (max-width: 420px) {
    body.tc-page-chat .tc-chat-main {
        height: calc(100dvh - 4rem) !important;
        max-height: calc(100dvh - 4rem) !important;
        padding-bottom: 6.2rem !important;
    }

    body.tc-page-chat #tc-chat-form {
        left: .4rem !important;
        right: .4rem !important;
        bottom: calc(.4rem + env(safe-area-inset-bottom, 0px)) !important;
    }
}
