/* The mobile bottom tab bar — Create, Storybooks, Chapters, Storyteller, Account.
   ONE copy, for every agent-facing page.

   It started life inline in index.html: markup, CSS and JS all in that one file.
   Adding it to the Design Studio meant either a second copy — which is how the
   pricing pages ended up telling three different stories about the same product —
   or pulling it out here. So: here.

   --tabbar-h is published by tabbar.js after mount, measured from the real bar
   rather than guessed, because the bar grows when the plan-gated tabs appear.
   Anything that floats above the bar (the Publish button on Create, Save in the
   Studio) sits on var(--tabbar-h). Guessing it is how a 3px strip of the page
   ended up showing between the Publish button and the bar. */

/* THE FALLBACKS ARE THE DASHBOARD'S REAL VALUES, not approximations.
   studio.html has its own smaller palette and defines none of these tokens, so
   every one of them fell through to whatever I had typed here — and the two
   bars came out with different border weights, different label colours and a
   different active tint. Thomas saw it immediately: "the nav bar at the bottom
   doesn't match the nav bar on the rest of the site." A fallback that differs
   from the token it stands in for is not a fallback, it is a second design. */
.mtabbar{position:fixed;left:0;right:0;bottom:0;z-index:70;display:none;justify-content:space-around;gap:6px;
  background:var(--surface,#160d03);border-top:1.5px solid var(--accent-mid,rgba(201,168,76,.72));
  padding:8px 8px calc(8px + env(safe-area-inset-bottom));backdrop-filter:blur(14px);
  box-shadow:0 -7px 24px rgba(0,0,0,.34);}
.mtab{flex:1;background:none;border:1px solid transparent;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  padding:8px 4px;min-height:54px;border-radius:14px;color:var(--text-mut,rgba(232,220,190,.58));font-family:'DM Sans',sans-serif;font-size:15px;font-weight:600;letter-spacing:.05em;transition:background .2s ease,color .2s ease,border-color .2s ease;}
.mtab svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.mtab.active{color:var(--gold,#C9A84C);background:var(--accent-faint,rgba(201,168,76,.06));border-color:var(--accent-mid,rgba(201,168,76,.72));font-weight:700;}

/* Rendered at 390px, five 15px labels clip "Account" to "Ac". The label drops to
   13px only when the extra tabs are actually present, so the common three-tab bar
   is untouched — and the 54px tap target does not change either way. */
.mtabbar.tabs-many .mtab{font-size:13px;letter-spacing:.01em;}
.mtabbar.tabs-many .mtab span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

@media (max-width:820px){
  .mtabbar{display:flex;}
}

/* While a field is focused the keyboard owns the bottom of the screen. Hiding
   the bar is the page's call, not the bar's — index.html sets body.kb-open from
   a viewport-resize watcher, because on iOS the keyboard is a viewport event and
   treating it as a focus event is what stranded the bar for whole sessions. */
body.kb-open .mtabbar{display:none;}
