/* The platform as an app on phones (contract 3: «منصة ويب (Web App)»): bottom tab bar instead of the top menu, the
   phone's safe areas (notch, home indicator), the install offer, and the installed app's own look. */
.app-tabbar { display: none; }

@media (max-width: 768px), (display-mode: standalone) and (max-width: 1024px) {
  .site-nav { display: none; }
  body.has-site-header { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .app-tabbar { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 950; justify-content: space-around; align-items: stretch;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
    background: var(--glass-strong); border-top: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
    box-shadow: 0 -8px 28px var(--shadow-dark); }
  html[data-theme="light"] .app-tabbar { background: rgba(255, 255, 255, 0.86); }
  .app-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.18rem; min-height: 52px;
    border-radius: 14px; text-decoration: none; color: var(--text-secondary); font-size: 0.7rem; font-weight: 600;
    -webkit-tap-highlight-color: transparent; transition: color 0.25s, background 0.25s; }
  .app-tab svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .app-tab.is-current { color: var(--primary-light); background: var(--primary-glow); }
  html[data-theme="light"] .app-tab.is-current { color: var(--primary); }
  .app-tab.is-current svg { fill: var(--primary-glow); }
  .app-tab:active { transform: scale(0.94); }
  .footer { padding-bottom: 1.2rem; }
}

/* notch and status bar */
.site-header { padding-top: max(0.4rem, env(safe-area-inset-top)); }
body.has-site-header { padding-top: calc(52px + env(safe-area-inset-top)); }

/* the installed app: no text selection on controls, no overscroll glow, and the tab bar on tablets too */
html.is-installed-app { overscroll-behavior-y: none; }
html.is-installed-app .app-tab, html.is-installed-app .btn, html.is-installed-app .chip { -webkit-user-select: none; user-select: none; }

/* the install offer */
.app-install {
  background: var(--bg-top); border: 1px solid var(--glass-border);
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem;
  margin-block: 1.5rem 0; padding: 0.75rem 0.9rem; border-radius: 20px;
}
.app-install img { border-radius: 12px; flex: 0 0 auto; }
.app-install-text { display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 9rem; min-width: 0; font-size: 0.82rem; color: var(--text-secondary); }
.app-install-text strong { color: var(--text-primary); font-size: 0.92rem; }
.app-install-button { padding: 0.5rem 1rem; font-size: 0.88rem; }
.app-install-close { border: 0; background: transparent; color: var(--text-secondary); font-size: 1rem; cursor: pointer; padding: 0.3rem; }

