/* ============================================================
   Oletrak mobile bottom navigation
   ------------------------------------------------------------
   Scoped to phone widths only (<= 700px, matching the public
   navbar breakpoint). Nothing here changes the desktop layout.
   The bar reserves its own space on <body>, and the fixed
   controls that used to sit at the bottom are lifted above it.

   Load after theme.css so the dark-mode and lift rules win the
   cascade without !important.
   ============================================================ */

html.mbn-on {
  --mbn-bar-height: 68px;
  --mbn-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mbn-total-height: calc(var(--mbn-bar-height) + var(--mbn-safe-bottom));
  scroll-padding-bottom: calc(var(--mbn-total-height) + 16px);
}

/* The account and admin panels carry a little more weight: their icons are
   larger and the bar is a touch taller so the labels still breathe. */
html.mbn-context-user,
html.mbn-context-admin {
  --mbn-bar-height: 72px;
}

/* The renderer adds .has-mbn to <body>; html.mbn-on is applied in <head> so
   the reserved space exists before first paint (no layout shift). */
@media (max-width: 700px) {
  html.mbn-on body {
    padding-bottom: calc(var(--mbn-total-height) + 18px);
  }

  /* A smooth country/folder prefix keeps working: all links are relative. */
  html.mbn-on .mbn-bar {
    display: block;
  }

  /* The account panel's fixed rail and the admin panel's horizontal bottom
     bar are both replaced by the tab bar on phones. Nothing is lost: every
     destination in those menus also lives in the More sheet. */
  html.mbn-on.mbn-context-user .sidebar {
    display: none !important;
  }

  html.mbn-on.mbn-context-user .main-content {
    margin-left: 0 !important;
  }

  html.mbn-on.mbn-context-admin #header {
    display: none !important;
  }

  html.mbn-on.mbn-context-admin main#main-content,
  html.mbn-on.mbn-context-admin #header + main {
    margin-left: 0 !important;
    margin-bottom: 0 !important;
  }

  /* The old hamburger and its drawer are replaced by the tab bar on these
     pages. Other pages never load this stylesheet, so their menu is intact. */
  html.mbn-on .nav-bar .mobile-nav-icon.js-show-mobile,
  html.mbn-on .nav-bar .js-mobile-nav,
  html.mbn-on .nav-bar .mobile-nav-overlay {
    display: none !important;
  }

  /* The marketing home page keeps its slide-in drawer: it is the only place
     the language picker and the sign-in chip live on a phone. */
  html.mbn-on body.home .nav-bar .mobile-nav-icon.js-show-mobile {
    display: flex !important;
  }

  html.mbn-on body.home .nav-bar .js-mobile-nav:not(.hidden) {
    display: flex !important;
  }

  html.mbn-on body.home .nav-bar .mobile-nav-overlay.is-visible {
    display: block !important;
  }

  /* A modal filter drawer owns the whole screen: let it, instead of putting
     the tab bar over its Apply footer. */
  html.mbn-on.mk-drawer-open .mbn-bar {
    display: none;
  }
}

/* ------------------------------------------------------------ bar shell */
.mbn-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12501;
  display: none;
  box-sizing: border-box;
  height: var(--mbn-total-height, calc(68px + env(safe-area-inset-bottom, 0px)));
  padding-bottom: var(--mbn-safe-bottom, env(safe-area-inset-bottom, 0px));
  background: var(--color-surface, #ffffff);
  border-top: 1px solid var(--color-border, #e3eaf2);
  box-shadow: 0 -10px 30px rgba(2, 42, 70, 0.12);
  font-family: var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
  -webkit-tap-highlight-color: transparent;
}

.mbn-bar__inner {
  height: var(--mbn-bar-height, 68px);
}

.mbn-bar__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mbn-bar__item {
  min-width: 0;
  height: 100%;
}

.mbn-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 7px 3px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-on-muted, #5b6b80);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.mbn-tab:hover {
  color: var(--brand-orange-700, #a8410a);
  background: rgba(255, 127, 17, 0.07);
}

.mbn-tab.is-active {
  color: var(--brand-orange-700, #a8410a);
  font-weight: 700;
}

.mbn-tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: currentColor;
  transform: translateX(-50%);
}

.mbn-tab__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

.mbn-tab__icon {
  display: block;
  width: 26px;
  height: 26px;
}

/* Panel bars get a larger, easier-to-hit icon set. */
html.mbn-context-user .mbn-tab__icon-wrap,
html.mbn-context-admin .mbn-tab__icon-wrap,
html.mbn-context-user .mbn-tab__icon,
html.mbn-context-admin .mbn-tab__icon {
  width: 28px;
  height: 28px;
}

.mbn-tab__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mbn-tab:focus-visible {
  outline: 3px solid var(--brand-orange-700, #a8410a);
  outline-offset: -3px;
  border-radius: 8px;
}

[data-theme="dark"] .mbn-bar {
  background: #0f1b2d;
  border-top-color: #26374e;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .mbn-tab {
  color: #a8b8cc;
}

[data-theme="dark"] .mbn-tab:hover,
[data-theme="dark"] .mbn-tab.is-active {
  color: var(--brand-gold, #ffd166);
}

[data-theme="dark"] .mbn-tab:hover {
  background: rgba(255, 209, 102, 0.08);
}

[data-theme="dark"] .mbn-tab:focus-visible {
  outline-color: var(--brand-gold, #ffd166);
}

/* ------------------------------------------------------------ More sheet */
.mbn-sheet {
  position: fixed;
  inset: 0;
  z-index: 12500;
  display: block;
  pointer-events: none;
}

.mbn-sheet[hidden] {
  display: none;
}

.mbn-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 20, 38, 0.58);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 240ms ease;
}

.mbn-sheet.is-open .mbn-sheet__backdrop {
  opacity: 1;
}

.mbn-sheet:not(.is-open) .mbn-sheet__backdrop,
.mbn-sheet:not(.is-open) .mbn-sheet__panel {
  pointer-events: none;
}

.mbn-sheet__panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(var(--mbn-total-height, 64px) + 8px);
  box-sizing: border-box;
  max-width: 560px;
  max-height: calc(100vh - var(--mbn-total-height, 64px) - 20px);
  max-height: min(calc(100dvh - var(--mbn-total-height, 64px) - 20px), 78dvh);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border, #e3eaf2);
  border-radius: 20px;
  background: var(--color-surface, #ffffff);
  color: var(--color-on-surface, #24344a);
  box-shadow: 0 24px 70px rgba(1, 20, 38, 0.35);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(calc(100% + var(--mbn-total-height, 64px) + 20px));
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.mbn-sheet.is-open .mbn-sheet__panel {
  opacity: 1;
  transform: none;
}

.mbn-sheet__handle {
  flex: 0 0 auto;
  width: 38px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--color-border, #d7e0ea);
}

.mbn-sheet__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid var(--color-border, #e3eaf2);
}

/* Same type treatment as the nav-v3 drawer's section label. */
.mbn-sheet__title {
  margin: 0;
  color: var(--color-on-muted, #5b6b80);
  font: 600 12px/1.25 var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mbn-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-muted, #eef2f7);
  color: var(--color-on-surface, #24344a);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.mbn-sheet__close:hover {
  background: rgba(255, 127, 17, 0.14);
  color: var(--brand-orange-700, #a8410a);
}

.mbn-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 20px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.mbn-sheet__group {
  padding: 13px 0 4px;
}

.mbn-sheet__group + .mbn-sheet__group {
  border-top: 1px solid var(--color-border, #e3eaf2);
}

.mbn-sheet__group-title {
  margin: 0 0 4px;
  padding-inline: 12px;
  color: var(--color-on-muted, #5b6b80);
  font: 600 11.5px/1.3 var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mbn-sheet__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Rows match the nav-v3 drawer: rounded 44px targets on the leading edge,
   separated by 2px rather than hairlines, with the current page marked by an
   inset accent bar. */
.mbn-sheet__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  min-height: 44px;
  margin: 2px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: var(--color-on-surface, #24344a);
  /* px, not rem: several legacy pages set html{font-size:10px}, which shrank
     these rows to 9.5px while the nav-v3 drawer stayed at 15px. */
  font: 500 15px/1.3 var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms ease, color 140ms ease;
}

.mbn-sheet__list li:last-child .mbn-sheet__link {
  border-bottom: 0;
}

.mbn-sheet__link:hover {
  color: var(--color-on-surface, #24344a);
  background: var(--color-muted, #eef2f7);
}

.mbn-sheet__link.is-active,
.mbn-sheet__link[aria-current="page"] {
  background: var(--color-muted, #eef2f7);
  box-shadow: inset 3px 0 0 0 var(--brand-orange-500, #ff7f11);
}

[data-theme="dark"] .mbn-sheet__link:hover,
[data-theme="dark"] .mbn-sheet__link.is-active,
[data-theme="dark"] .mbn-sheet__link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.07);
}

.mbn-sheet__chevron {
  flex: 0 0 auto;
  color: var(--color-on-muted, #8a9aad);
}

.mbn-sheet__link:focus-visible,
.mbn-sheet__close:focus-visible,
.mbn-theme:focus-visible {
  outline: 3px solid var(--brand-orange-700, #a8410a);
  outline-offset: 2px;
}

/* Log out is a <button> in the sheet: strip the browser chrome so it sits
   exactly like the neighbouring links. */
.mbn-sheet__link--button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mbn-sheet__list li:last-child .mbn-sheet__link--button {
  border-bottom: 0;
}

.mbn-sheet__link--danger {
  color: #b42318;
}

.mbn-sheet__link--danger:hover {
  color: #912018;
}

/* ------------------------------------------------------- create button */
.mbn-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--mbn-total-height, 68px) + 14px);
  z-index: 12501;
  display: none;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-orange-500, #ff7f11), #ff9d2e);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(255, 127, 17, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

@media (max-width: 700px) {
  html.mbn-context-user .mbn-fab {
    display: inline-flex;
  }
}

.mbn-fab__icon {
  display: block;
  width: 26px;
  height: 26px;
}

.mbn-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 32px rgba(255, 127, 17, 0.55);
}

.mbn-fab:active {
  transform: scale(0.96);
}

.mbn-fab:focus-visible {
  outline: 3px solid var(--brand-orange-700, #a8410a);
  outline-offset: 3px;
}

/* The button would sit on top of the backdrop otherwise. */
html.mbn-sheet-open .mbn-fab {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
}

/* ------------------------------------------------------ create sheet */
.mbn-action-panel {
  max-width: 460px;
}

.mbn-action-body {
  padding-top: 12px;
}

.mbn-action-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mbn-action-option {
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #e3eaf2);
  border-radius: 14px;
  background: var(--color-surface, #ffffff);
  color: var(--color-on-surface, #24344a);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.mbn-action-option:hover {
  border-color: rgba(255, 127, 17, 0.45);
  background: rgba(255, 127, 17, 0.06);
}

.mbn-action-option:focus-visible {
  outline: 3px solid var(--brand-orange-700, #a8410a);
  outline-offset: 2px;
}

.mbn-action-option__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 127, 17, 0.12);
  color: var(--brand-orange-700, #a8410a);
}

.mbn-action-option__icon .mbn-tab__icon {
  width: 22px;
  height: 22px;
}

.mbn-action-option__copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mbn-action-option__label {
  font: 600 0.98rem/1.25 var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
}

.mbn-action-option__hint {
  color: var(--color-on-muted, #5b6b80);
  font: 400 0.8rem/1.3 var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
}

.mbn-action-option .mbn-sheet__chevron {
  flex: 0 0 auto;
  color: var(--color-on-muted, #8a9aad);
}

[data-theme="dark"] .mbn-sheet__link--button {
  border-color: #26374e;
}

[data-theme="dark"] .mbn-sheet__link--danger {
  color: #ff8a80;
}

[data-theme="dark"] .mbn-sheet__link--danger:hover {
  color: #ffb4ab;
}

[data-theme="dark"] .mbn-action-option {
  border-color: #26374e;
  background: #0f1b2d;
  color: #e8eef6;
}

[data-theme="dark"] .mbn-action-option:hover {
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.08);
}

[data-theme="dark"] .mbn-action-option__icon {
  background: rgba(255, 209, 102, 0.14);
  color: var(--brand-gold, #ffd166);
}

[data-theme="dark"] .mbn-action-option__hint,
[data-theme="dark"] .mbn-action-option .mbn-sheet__chevron {
  color: #91a4bb;
}

[data-theme="dark"] .mbn-action-option:focus-visible {
  outline-color: var(--brand-gold, #ffd166);
}

/* Theme control inside the sheet — a pill that hugs its label, never a
   full-width bar: full-width made it read like another navigation row. */
.mbn-theme {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-height: 40px;
  margin: 2px 0 6px;
  padding: 0 14px;
  border: 1px solid var(--color-border, #e3eaf2);
  border-radius: 999px;
  background: var(--color-muted, #eef2f7);
  color: var(--color-on-surface, #24344a);
  font: 500 14px/1.3 var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
  text-align: left;
  cursor: pointer;
}

.mbn-theme__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--color-muted, #eef2f7);
  color: var(--color-primary, #06426e);
}

.mbn-theme__label {
  flex: 0 1 auto;
  white-space: nowrap;
}

.mbn-theme__track {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background-color 180ms ease;
}

.mbn-theme__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 180ms ease;
}

.mbn-theme[aria-pressed="true"] .mbn-theme__track {
  background: var(--brand-orange-500, #ff7f11);
}

.mbn-theme[aria-pressed="true"] .mbn-theme__knob {
  transform: translateX(20px);
}

[data-theme="dark"] .mbn-sheet__panel {
  border-color: #26374e;
  background: #101d30;
  color: #e8eef6;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .mbn-sheet__handle {
  background: #394b63;
}

[data-theme="dark"] .mbn-sheet__header,
[data-theme="dark"] .mbn-sheet__group + .mbn-sheet__group,
[data-theme="dark"] .mbn-sheet__link {
  border-color: #26374e;
}

[data-theme="dark"] .mbn-sheet__title {
  color: #f0f5fb;
}

[data-theme="dark"] .mbn-sheet__group-title {
  color: #91a4bb;
}

[data-theme="dark"] .mbn-sheet__close {
  background: #1b2a40;
  color: #e8eef6;
}

[data-theme="dark"] .mbn-sheet__close:hover,
[data-theme="dark"] .mbn-sheet__link:hover {
  color: var(--brand-gold, #ffd166);
}

[data-theme="dark"] .mbn-sheet__link {
  color: #e8eef6;
}

[data-theme="dark"] .mbn-sheet__chevron {
  color: #7f93aa;
}

[data-theme="dark"] .mbn-sheet__link:focus-visible,
[data-theme="dark"] .mbn-sheet__close:focus-visible,
[data-theme="dark"] .mbn-theme:focus-visible {
  outline-color: var(--brand-gold, #ffd166);
}

[data-theme="dark"] .mbn-theme {
  border-color: #26374e;
  background: #16233a;
  color: #e8eef6;
}

[data-theme="dark"] .mbn-theme__icon {
  background: #1b2a40;
  color: var(--brand-gold, #ffd166);
}

[data-theme="dark"] .mbn-theme__track { background: #33475f; }

/* ------------------------------------------------------------ fixed chrome
   Keep the existing floating controls above the new bar instead of letting
   the bar cover them. */
@media (max-width: 700px) {
  /* Theme pill sits above the tab bar on the right edge (its default
     corner), clear of the left-hand filter button. */
  html.mbn-on .theme-toggle {
    left: auto;
    right: 16px;
    bottom: calc(var(--mbn-total-height) + 78px);
  }

  html.mbn-on .home-to-top {
    bottom: calc(var(--mbn-total-height) + 12px);
  }

  html.mbn-on .mk-filter-fab {
    left: 16px;
    right: auto;
    bottom: calc(var(--mbn-total-height) + 16px);
  }

  html.mbn-on #pwaInstallBanner {
    bottom: var(--mbn-total-height);
  }

  html.mbn-on .otk-toast-stack {
    bottom: calc(var(--mbn-total-height) + 12px);
  }

  /* The cookie banner is a bottom card, not a full-screen layer. Sit it on
     top of the tab bar so both stay usable while consent is undecided. */
  html.mbn-on .oletro-bn {
    bottom: calc(var(--mbn-total-height) + 16px);
    max-height: calc(100vh - var(--mbn-total-height) - 32px);
    max-height: calc(100dvh - var(--mbn-total-height) - 32px);
    overflow-y: auto;
  }
}

@media (max-width: 360px) {
  html.mbn-on {
    --mbn-bar-height: 64px;
  }

  html.mbn-on.mbn-context-user,
  html.mbn-on.mbn-context-admin {
    --mbn-bar-height: 68px;
  }

  .mbn-tab {
    font-size: 10.5px;
  }
}

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mbn-tab,
  .mbn-fab,
  .mbn-action-option,
  .mbn-sheet__backdrop,
  .mbn-sheet__panel,
  .mbn-sheet__close,
  .mbn-theme__track,
  .mbn-theme__knob {
    transition: none;
  }
}

/* Printing a page must not print the fixed chrome. */
@media print {
  .mbn-bar,
  .mbn-sheet,
  .mbn-fab {
    display: none !important;
  }
}

/* ==================================================================
   PHONE BAR — compact icon rail
   ------------------------------------------------------------------
   Every tab keeps a small caption under its glyph, because a rail of
   bare icons makes people guess where a tap will take them. The
   captions are quiet at 9px, and the current one is the only bold,
   fully inked row, sitting above a shallow arc. The list scrolls
   horizontally when it has more items than fit, and the active tab is
   scrolled into the middle of the bar on load.

   Deliberately plain: one ink colour for idle tabs, one accent for the
   current one, no gradients, no shadows. Both themes are covered.
   ================================================================== */
@media (max-width: 700px) {
  html.mbn-on,
  html.mbn-on.mbn-context-user,
  html.mbn-on.mbn-context-admin {
    --mbn-bar-height: 60px;
  }

  html.mbn-on .mbn-bar {
    box-shadow: none;
  }

  html.mbn-on .mbn-bar__list {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  html.mbn-on .mbn-bar__list::-webkit-scrollbar {
    display: none;
  }

  html.mbn-on .mbn-bar__item {
    flex: 0 0 auto;
    min-width: 62px;
  }

  /* A little air between destinations: each tab reads as its own target
     instead of one continuous strip of icons. */
  html.mbn-on .mbn-tab {
    justify-content: center;
    gap: 2px;
    padding: 4px 9px 6px;
    border-radius: 0;
    font-size: 9px;
    line-height: 1.1;
  }

  html.mbn-on .mbn-tab:hover {
    background: transparent;
    color: var(--color-on-muted, #5b6b80);
  }

  html.mbn-context-user .mbn-tab__icon-wrap,
  html.mbn-context-admin .mbn-tab__icon-wrap,
  html.mbn-context-user .mbn-tab__icon,
  html.mbn-context-admin .mbn-tab__icon,
  html.mbn-on .mbn-tab__icon-wrap,
  html.mbn-on .mbn-tab__icon {
    width: 20px;
    height: 20px;
  }

  /* Every tab names itself; idle captions stay quiet so the current one
     still reads as the active row. */
  html.mbn-on .mbn-tab__label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.005em;
    opacity: 0.72;
  }

  html.mbn-on .mbn-tab.is-active {
    color: var(--brand-orange-700, #a8410a);
  }

  /* The desktop bar paints a top rule on the active tab; the phone rail
     uses an arc instead, so the top rule is switched off here. */
  html.mbn-on .mbn-tab::before {
    content: none;
    display: none;
  }

  /* The curved indicator: a shallow arc under the active caption. It is
     absolutely placed so every tab keeps the same content height and no
     glyph shifts when the current page changes. */
  html.mbn-on .mbn-tab.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 22px;
    height: 5px;
    border-radius: 0 0 999px 999px;
    border-bottom: 2px solid currentColor;
    background: none;
    transform: translateX(-50%);
    pointer-events: none;
  }

  /* The current destination's caption is the one that goes full ink. */
  html.mbn-on .mbn-tab.is-active .mbn-tab__label {
    display: block;
    max-width: 100%;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.01em;
    opacity: 1;
  }

  /* Dark theme pins the same two colours to the dark surface tokens, at the
     specificity the base dark rules set earlier in this file need. */
  html.mbn-on[data-theme="dark"] .mbn-tab,
  html.mbn-on[data-theme="dark"] .mbn-tab:hover {
    background: transparent;
    color: #a8b8cc;
  }

  html.mbn-on[data-theme="dark"] .mbn-tab.is-active {
    color: var(--brand-gold, #ffd166);
  }
}

/* ==================================================================
   ONE-TIME SCROLL HINT
   ------------------------------------------------------------------
   Sits just above the rail, over the page content, for six seconds on the
   first visit only. A small caption plus an arrow that nudges in the
   direction the rail actually scrolls. Plain surface, one accent, both
   themes; no shadow.
   ================================================================== */
.mbn-scroll-hint {
  position: fixed;
  right: 12px;
  bottom: calc(var(--mbn-bar-height, 60px) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 9997;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--brand-orange-500, #ff7f11);
  background: var(--color-surface, #ffffff);
  color: var(--brand-orange-700, #a8410a);
  font-family: var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  pointer-events: none;
  animation: mbn-hint-in 260ms ease-out both;
}

.mbn-scroll-hint__text {
  white-space: nowrap;
}

.mbn-scroll-hint__arrow {
  flex: none;
  animation: mbn-hint-nudge 1.1s ease-in-out infinite;
}

/* Pointing left: the arrow sits before the caption and nudges left. */
.mbn-scroll-hint.is-back .mbn-scroll-hint__arrow {
  order: -1;
  animation-name: mbn-hint-nudge-back;
}

.mbn-scroll-hint.is-leaving {
  animation: mbn-hint-out 300ms ease-in both;
}

@keyframes mbn-hint-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes mbn-hint-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(6px); }
}

@keyframes mbn-hint-nudge {
  0%, 60%, 100% { transform: translateX(0); }
  30% { transform: translateX(4px); }
}

@keyframes mbn-hint-nudge-back {
  0%, 60%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
}

[data-theme="dark"] .mbn-scroll-hint {
  background: #0f1b2d;
  border-color: #2f4a6b;
  color: var(--brand-gold, #ffd166);
}

@media (prefers-reduced-motion: reduce) {
  .mbn-scroll-hint,
  .mbn-scroll-hint__arrow {
    animation: none;
  }
}

/* ------------------------------------------------------- row scroll hint
   Same pill, but parked over the marketplace's sideways-scrolling product
   rows rather than above the rail. Position is set inline by
   showRowHint() in mobile-bottom-nav.js. */
.mk-swipe-hint {
  position: fixed;
  right: 14px;
  z-index: 9996;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 28px);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--brand-orange-500, #ff7f11);
  background: var(--color-surface, #ffffff);
  color: var(--brand-orange-700, #a8410a);
  font-family: var(--font-sans, "Poppins", "Segoe UI", Tahoma, sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
  pointer-events: none;
  animation: mbn-hint-in 260ms ease-out both;
}

.mk-swipe-hint__text {
  white-space: nowrap;
}

.mk-swipe-hint__arrow {
  flex: none;
  animation: mbn-hint-nudge 1.1s ease-in-out infinite;
}

.mk-swipe-hint.is-back .mk-swipe-hint__arrow {
  order: -1;
  animation-name: mbn-hint-nudge-back;
}

.mk-swipe-hint.is-leaving {
  animation: mbn-hint-out 300ms ease-in both;
}

[data-theme="dark"] .mk-swipe-hint {
  background: #0f1b2d;
  border-color: #2f4a6b;
  color: var(--brand-gold, #ffd166);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .mk-swipe-hint,
  .mk-swipe-hint__arrow {
    animation: none;
  }
}
