/* mobile-shell — telefon qabığı: üst panel + məzmun + alt tab bar.
 *
 * Web qabığından (app-shell) fərqi struktural deyil, FİZİKİdir:
 *  - naviqasiya ALTDA qalır, çünki barmaq ekranın aşağı üçdə birinə çatır;
 *  - toxunma hədəfləri >= 2.75rem (44px) - kursor dəqiqliyi yoxdur;
 *  - alt panel `safe-area-inset-bottom` qədər aşağıdan doldurulur ki,
 *    jest zolağı olan telefonlarda etiketlər onun altında qalmasın.
 */

.mobile-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

/* --- Üst panel */

.mobile-shell__topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: var(--space-2);
  min-height: 3.5rem;
  padding: var(--space-2) var(--space-3);
  padding-top: max(var(--space-2), env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mobile-shell__back,
.mobile-shell__action {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.mobile-shell__back:hover,
.mobile-shell__action:hover { background: var(--hover-veil); }

.mobile-shell__back:focus-visible,
.mobile-shell__action:focus-visible,
.mobile-shell__tab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.mobile-shell__back .icon,
.mobile-shell__action .icon { width: 1.375rem; height: 1.375rem; }

.mobile-shell__title {
  margin: 0;
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  text-align: center;
  /* Uzun başlıq alt sətrə keçib paneli böyütməməlidir. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Məzmun sahəsi */

.mobile-shell__main {
  padding: var(--space-4) var(--space-4) var(--space-8);
  overflow-x: hidden;
}

/* --- Alt tab bar */

.mobile-shell__tabbar {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  justify-content: space-around;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.mobile-shell__tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 2.75rem;
  padding: var(--space-1);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--size-2xs);
  line-height: var(--leading-tight);
}

.mobile-shell__tab .icon { width: 1.5rem; height: 1.5rem; }

.mobile-shell__tab:hover { background: var(--hover-veil); }

.mobile-shell__tab--active {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

.mobile-shell__badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  background: var(--danger);
  color: var(--on-danger);
  font-size: var(--size-2xs);
  font-weight: var(--weight-semibold);
}

/* Tab ikonunun üstündəki nişan - ikonu yerindən oynatmadan. */
.mobile-shell__tab-icon {
  position: relative;
  display: grid;
  place-items: center;
}

.mobile-shell__tab-icon .mobile-shell__badge {
  position: absolute;
  top: -0.25rem;
  inset-inline-start: 55%;
}

/* Planşet və yuxarı: qabıq telefon üçün qurulub, geniş ekranda
   məzmun oxunaqlı enlə mərkəzləşir. */
@media (min-width: 40rem) {
  .mobile-shell__main {
    max-width: 32rem;
    margin-inline: auto;
    width: 100%;
  }
}
