/* Rental OTP — mobile shell + public tab bar + drawer fix */

:root {
  --mtab-h: 72px;
  --mtab-safe: env(safe-area-inset-bottom, 0px);
}

/* ===== Fix: mobile drawer under scrim (clicks / blur) =====
   .shell { z-index:1 } trapped the fixed .side below .nav-scrim.
   Reset stacking on small screens and put the drawer above the scrim. */
@media (max-width: 980px) {
  .shell-body .shell {
    z-index: auto;
  }

  .shell-body .nav-scrim {
    z-index: 90 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(5, 10, 18, 0.55) !important;
  }

  .shell-body .side {
    z-index: 100 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important;
    box-shadow: 18px 0 40px -18px rgba(7, 17, 31, 0.45);
    padding-bottom: calc(12px + var(--mtab-safe));
  }

  [data-theme="dark"] .shell-body .side {
    background: #0c1422 !important;
  }

  .shell-body .side .nav a,
  .shell-body .side .nav-drop-btn,
  .shell-body .side button,
  .shell-body .side a {
    pointer-events: auto;
    position: relative;
    z-index: 1;
  }
}

/* ===== Shell small-phone hardening ===== */
@media (max-width: 480px) {
  .shell-body .content { padding: 14px 12px calc(24px + var(--mtab-safe)); gap: 12px; }
  .shell-body .top { padding: 8px 10px; min-height: 54px; }
  .shell-body .crumb-parent { display: none; }
  .shell-body .crumb-title { font-size: 1.02rem; }
  .shell-body .side-brand { padding: 14px 12px; }
}

@media (max-width: 720px) {
  .shell-body {
    overflow-x: hidden;
  }
  .shell-body .shell,
  .shell-body .content {
    max-width: 100%;
    min-width: 0;
  }
  .shell-body .content > table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.shell-body .content input,
.shell-body .content select,
.shell-body .content textarea {
  max-width: 100%;
}

/* Keep tab bar visible; drawer sits above it. Hide only if it overlaps brand. */
body.nav-open .mobile-tabbar {
  opacity: 0.35;
  pointer-events: none;
}

/* ===== Premium bottom tab bar ===== */
.mobile-tabbar {
  display: none;
  align-items: stretch;
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--mtab-safe));
  z-index: 80;
  height: 64px;
  padding: 6px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,248,252,0.96));
  border: 1px solid rgba(7, 17, 31, 0.08);
  box-shadow:
    0 18px 40px -18px rgba(7, 17, 31, 0.45),
    0 1px 0 rgba(255,255,255,0.8) inset;
}

[data-theme="dark"] .mobile-tabbar {
  background: linear-gradient(180deg, rgba(18, 28, 44, 0.98), rgba(10, 16, 28, 0.96));
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
}

@media (max-width: 900px) {
  body.shell-user .mobile-tabbar,
  body.public-body .mobile-tabbar {
    display: flex;
  }

  body.shell-user .content {
    padding-bottom: calc(var(--mtab-h) + 28px + var(--mtab-safe));
  }

  body.shell-user .chat-fab-wrap {
    bottom: calc(var(--mtab-h) + 18px + var(--mtab-safe)) !important;
  }

  body.public-body {
    padding-bottom: calc(var(--mtab-h) + 18px + var(--mtab-safe));
  }

  body.public-body .site-foot {
    padding-bottom: calc(36px + var(--mtab-h) + var(--mtab-safe));
  }
}

.mobile-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  margin: 0;
  border-radius: 16px;
  color: #66758c;
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
[data-theme="dark"] .mobile-tab { color: #9aa8bc; }

.mobile-tab:hover,
.mobile-tab:focus-visible {
  color: #0f766e;
  text-decoration: none;
}

.mobile-tab-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 12px;
  background: transparent;
  transition: background 0.2s ease, transform 0.2s ease;
}
.mobile-tab-ico svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
}
.mobile-tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
}

.mobile-tab.is-on {
  color: #0d9488;
}
[data-theme="dark"] .mobile-tab.is-on {
  color: #5eead4;
}
.mobile-tab.is-on .mobile-tab-ico {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.22), rgba(245, 158, 11, 0.16));
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -12px rgba(13, 148, 136, 0.8);
}

@media (prefers-reduced-motion: reduce) {
  .mobile-tab,
  .mobile-tab-ico { transition: none; }
}
