/* HealthTeky mobile app layer (added to every page by healthteky.pwa.MobileAppMiddleware): bottom tab bar on phones,
   install prompt, wide tables that scroll in their own box. */
:root { --app-tabbar-h: 56px; --app-safe-bottom: env(safe-area-inset-bottom, 0px); --app-brand: linear-gradient(90deg, #0d6efd, #00a3a1); }
html, body { overflow-x: clip; max-width: 100%; }
body { -webkit-tap-highlight-color: transparent; }

.app-tabbar { display: none; }
@media (max-width: 960px) {
    /* plain white bar, line icons only (labels stay for screen readers); the open tab sits in a light grey pill */
    .app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        height: calc(var(--app-tabbar-h) + var(--app-safe-bottom)); padding: 0 6px var(--app-safe-bottom); background: #fff;
        border-top: 1px solid #e8edf2; box-shadow: 0 -4px 16px rgba(11, 37, 69, .06); }
    .app-tab { display: flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none !important; user-select: none; }
    .app-tab .app-i { width: 52px; height: 38px; padding: 8px 14px; border-radius: 14px; color: #6b7f93; transition: transform .15s, background .15s, color .15s; }
    .app-tab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .app-tab:active .app-i { transform: scale(.88); }
    .app-tab.active .app-i { background: #eef3f7; color: #15263a; }
    body.has-app-tabbar { padding-bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom)); }
    body.has-app-tabbar .app-install { bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom) + 10px); }
}

.app-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

.app-install { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1050; display: flex; align-items: center; gap: 12px; padding: 12px;
    background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(11, 37, 69, .22); animation: app-slide-up .25s ease-out; }
.app-install img { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.app-install .app-install-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; color: #14213d; }
.app-install .app-install-text strong { display: block; font-size: 14px; }
.app-install button { height: 36px; border: 0; border-radius: 10px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.app-install .app-install-go { padding: 0 16px; color: #fff; background: var(--app-brand); }
.app-install .app-install-close { width: 36px; background: #eef4fa; color: #4a6078; font-size: 18px; }
@keyframes app-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (display-mode: standalone) { .app-install { display: none !important; } }
@media print { .app-tabbar, .app-install { display: none !important; } }
