/* Mobile bottom navigation: six real destinations in RTL order. */
@media (max-width: 760px) {
  body { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    inset-inline: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    width: auto;
    height: 76px;
    display: flex;
    flex-flow: row nowrap;
    direction: rtl;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    padding: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: inline mandatory;
    border: 1px solid #baff45;
    border-radius: 18px;
    background: rgb(14 20 12 / 97%);
    box-shadow: 0 0 18px rgb(186 255 69 / 24%), 0 8px 26px rgb(0 0 0 / 38%), inset 0 0 14px rgb(186 255 69 / 6%);
    backdrop-filter: blur(16px);
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav a {
    box-sizing: border-box;
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgb(186 255 69 / 42%);
    border-radius: 12px;
    color: #d6e6bf;
    font-size: 21px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    scroll-snap-align: start;
  }
  .mobile-nav a > span { display: block; line-height: 1; }
  .mobile-nav small { display: block; font-size: 9px; line-height: 1.2; letter-spacing: 0; white-space: nowrap; }
  .mobile-nav a:hover, .mobile-nav a:focus-visible, .mobile-nav a[aria-current="page"] {
    color: #d7ff7b;
    border-color: #baff45;
    background: rgb(186 255 69 / 12%);
    outline-color: #baff45;
  }
  .mobile-sticky { bottom: calc(76px + max(8px, env(safe-area-inset-bottom))); }
  /* Scoped dark palette; keep the shared geometry and light palette intact. */
  html[data-theme="dark"] .mobile-nav {
    --nav-violet: #8b5cf6;
    --nav-indigo: #6366f1;
    --nav-blue: #3b82f6;
    border-color: rgb(139 92 246 / 48%);
    background: rgb(14 15 25 / 97%);
    box-shadow: 0 0 18px rgb(139 92 246 / 11%), 0 8px 26px rgb(0 0 0 / 38%), inset 0 0 14px rgb(59 130 246 / 4%);
  }
  html[data-theme="dark"] .mobile-nav a {
    color: #b8bdd2;
    border-color: rgb(139 92 246 / 20%);
  }
  html[data-theme="dark"] .mobile-nav a:hover,
  html[data-theme="dark"] .mobile-nav a:focus-visible,
  html[data-theme="dark"] .mobile-nav a:active {
    color: #eeeaff;
    border-color: var(--nav-violet);
    background: linear-gradient(125deg, rgb(139 92 246 / 12%), rgb(59 130 246 / 10%));
    outline-color: var(--nav-blue);
  }
  html[data-theme="dark"] .mobile-nav a[aria-current="page"] {
    color: #f1edff;
    border-color: var(--nav-indigo);
    background: linear-gradient(135deg, rgb(139 92 246 / 23%), rgb(99 102 241 / 19%), rgb(59 130 246 / 18%));
    outline-color: var(--nav-blue);
    box-shadow: inset 0 0 8px rgb(139 92 246 / 11%), inset 0 0 14px rgb(59 130 246 / 7%), 0 0 8px rgb(99 102 241 / 10%);
  }
  html[data-theme="dark"] .mobile-nav a[aria-current="page"] > span { color: #c4b5fd; }
  html[data-theme="light"] .mobile-nav {
    border-color: #d8e2ce;
    background: rgb(255 255 255 / 97%);
    box-shadow: 0 -5px 24px rgb(35 43 69 / 12%), 0 5px 18px rgb(35 43 69 / 8%);
  }
  html[data-theme="light"] .mobile-nav a { color: #59647a; border-color: #d8e2ce; }
  html[data-theme="light"] .mobile-nav a:hover,
  html[data-theme="light"] .mobile-nav a:focus-visible,
  html[data-theme="light"] .mobile-nav a[aria-current="page"] {
    color: #476d15;
    border-color: #8ebd36;
    background: rgb(155 211 54 / 14%);
    outline-color: #8ebd36;
  }
}
