/* Startner mobile navigation
 *
 * The app's tab bar is Tailwind `hidden md:flex`: display:none below 768px,
 * with nothing put in its place. On a phone there was no way to reach Home,
 * Start Business, Find a Partner, Messages, Vendors & Resources, AI Expert,
 * My Files, Jobs or Admin at all.
 *
 * Rather than build a second copy of the nav, this re-uses that same element
 * as a drop-down panel. The tabs stay exactly what the app renders - same
 * labels, same icons, same active state, same drop-down menus - so nothing
 * here has to be kept in sync when the nav changes.
 *
 * Everything keys off one class, `sn-mobile`, which mobile-nav.js puts on
 * <html> when the viewport is narrow. Keeping the switch in one place means
 * the phone layout can be inspected on a desktop screen by adding that class
 * by hand, and what you see is the same code path phones get - not a second
 * set of rules that can drift.
 */

:root {
  --sn-header-h: 64px;
  --sn-brand: #fd4c00;
}

/* Off unless the script says the viewport is small. */
.sn-mnav,
.sn-mnav-backdrop { display: none; }

/* ---------------------------------------------------------------- controls */

html.sn-mobile .sn-mnav {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  height: var(--sn-header-h);
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  z-index: 60;                        /* the app header is z-50 */
  pointer-events: none;               /* only the buttons take taps */
}

html.sn-mobile .sn-mnav-btn {
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .92);
  color: #0f172a;
  border-radius: 11px;
  width: 42px;
  height: 42px;                       /* comfortable tap target */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  transition: background .15s, transform .08s;
}
html.sn-mobile .sn-mnav-btn:active { transform: scale(.94); }
html.sn-mobile .sn-mnav-btn svg { width: 21px; height: 21px; display: block; }

/* Open state shows on the menu button so it reads as a toggle. */
html.sn-mobile.sn-nav-open .sn-mnav-toggle {
  background: var(--sn-brand);
  border-color: var(--sn-brand);
  color: #fff;
}

html.sn-mobile .sn-mnav-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .38);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease;
  z-index: 40;                        /* under the header, over the page */
}
html.sn-mobile.sn-nav-open .sn-mnav-backdrop { opacity: 1; visibility: visible; }

/* ------------------------------------- the tab group, reused as the panel */

/* Tailwind's `hidden` is display:none, so showing it needs !important. */
html.sn-mobile.sn-nav-open nav.startner-header .hidden.md\:flex {
  display: flex !important;
  position: fixed;
  top: var(--sn-header-h);
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
  max-height: calc(100vh - var(--sn-header-h));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 55;
}

/* Each tab was a small centred icon-over-label column built for a wide bar.
   In a list it wants to be a full-width row with a real tap target. */
html.sn-mobile.sn-nav-open nav.startner-header .hidden.md\:flex > * {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  width: 100% !important;
  min-height: 50px;
  margin: 0 !important;               /* cancels space-x-4's margin-left */
  padding: 12px 20px !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
  border-radius: 0 !important;
  text-align: left !important;
  white-space: normal !important;
  height: auto !important;
}

html.sn-mobile.sn-nav-open nav.startner-header .hidden.md\:flex > * > svg,
html.sn-mobile.sn-nav-open nav.startner-header .hidden.md\:flex > * svg:first-child {
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px;
  opacity: .75;
}

html.sn-mobile.sn-nav-open nav.startner-header .hidden.md\:flex > * + * {
  border-top: 1px solid rgba(15, 23, 42, .06);
}
html.sn-mobile.sn-nav-open nav.startner-header .hidden.md\:flex > *:active {
  background: rgba(15, 23, 42, .04);
}

/* ------------------------------------------------------------ the header */

/* The header's left slot is empty in the app and is where the control bar
   sits, so reserve room for it. */
html.sn-mobile nav.startner-header .flex.justify-between { padding-left: 96px; }

/* "API Tokens 1294 / + Add API Tokens" is desktop chrome, and it is what
   pushes the bell and avatar off a narrow screen. The tokens page is still
   reachable from the menu. */
html.sn-mobile nav.startner-header .flex.justify-between > div:last-child > div.flex.items-center.gap-2 {
  display: none !important;
}

/* Stop the page scrolling behind an open panel. */
html.sn-mobile.sn-nav-open,
html.sn-mobile.sn-nav-open body { overflow: hidden; }
