/* STG v99 — Mobile header & theme-toggle fix (loaded LAST, after dark-mode.css)
   Problem: later "force visible" rules kept the user-name / role pills visible on phones, so the
   panel header grew wider than the screen and pushed the Dark/Light toggle off-screen.
   Public site: the toggle sat inside the collapsed menu, so it was hidden until the menu opened. */

/* ---------- Public site (≤900px): toggle sits in the top bar beside the burger ---------- */
.theme-toggle.tt-bar{display:none !important}
@media (max-width:900px){
  html body:not(.pbody) > header .theme-toggle.tt-bar{display:inline-flex !important;margin:0 8px 0 auto !important;flex:none}
  html body:not(.pbody) > header .tt-bar + .burger{margin-left:0 !important}
  html body:not(.pbody) > header .bar{flex-wrap:wrap}
  /* the copy inside the opened menu is no longer needed */
  html body:not(.pbody) > header nav#nav .theme-toggle{display:none !important}
}

/* ---------- Panels (admin / candidate / employee / franchise / company), ≤960px ---------- */
@media (max-width:960px){
  html body.pbody .ptop{gap:8px !important;padding-left:10px !important;padding-right:10px !important;max-width:100vw;overflow:visible}
  html body.pbody .ptop .sbtn,
  html body.pbody .ptop .plogo{flex:none !important}
  html body.pbody .ptop .plogo img{height:34px !important;width:auto !important}
  html body.pbody .ptop .prole,
  html body.pbody .ptop .prole::before,
  html body.pbody .ptop .pname,
  html body.pbody .ptop .puser .pname,
  html body.admin-panel.pbody .ptop .puser .pname{display:none !important}
  html body.pbody .ptop .pright{margin-left:auto !important;min-width:0 !important;flex:0 1 auto !important;gap:6px !important}
  html body.pbody .ptop .pright > *{flex:none}
  html body.pbody .ptop .pweb{width:36px !important;height:36px !important;padding:0 !important;justify-content:center !important}
  html body.pbody .ptop .pweb span{display:none !important}
  html body.pbody .ptop .theme-toggle{display:inline-flex !important;width:36px !important;height:36px !important;min-width:36px !important;margin:0 !important}
  html body.pbody .ptop .lang a{padding:5px 7px !important;font-size:.74rem !important}
  html body.pbody .ptop .puser{padding:0 !important;gap:0 !important;background:none !important;border:0 !important}
  html body.pbody .ptop .pout{width:36px !important;height:36px !important;padding:0 !important}
  html body.pbody .ptop .pout span{display:none !important}
  html body.pbody .ptop .adm-notif-btn{width:36px !important;height:36px !important}
}
/* very small phones: drop the language switcher from the bar (still available on the public site) */
@media (max-width:380px){
  html body.pbody .ptop .lang{display:none !important}
  html body.pbody .ptop .ptop-gap,html body.pbody .ptop{gap:6px !important}
}
/* employee Check-in button must not squeeze the toggle */
@media (max-width:560px){
  html body.pbody .ptop .employee-workbar{margin:0 !important}
  html body.pbody .ptop .employee-workbar .work-btn{padding:7px 8px !important;font-size:.72rem !important;white-space:nowrap}
}
/* easier tap target on touch screens */
@media (hover:none){
  .theme-toggle{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
}

/* ---------- v100: public-site mobile menu opened as a thin empty bar ----------
   The header creates its own containing block for position:fixed, so "top + bottom" made the
   open menu only ~34px tall (links clipped). Give the menu an explicit height instead. */
@media (max-width:900px){
  html body:not(.pbody) > header nav#nav.open{
    bottom:auto !important;
    height:auto !important;
    max-height:calc(100vh - 90px) !important;
    max-height:calc(100dvh - 90px) !important;
    flex-wrap:nowrap !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
  }
  html body:not(.pbody) > header nav#nav.open > *{flex:0 0 auto !important}
}

/* v100: tidy mobile menu content (left-aligned rows, collapsible sub-menus with readable text) */
@media (max-width:900px){
  html body:not(.pbody) > header nav#nav.open{gap:8px !important;align-items:stretch !important}
  html body:not(.pbody) > header nav#nav.open > a,
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-b{
    display:flex !important;align-items:center !important;justify-content:flex-start !important;gap:12px !important;
    width:100% !important;box-sizing:border-box !important;margin:0 !important;padding:13px 14px !important;
    background:rgba(255,255,255,.08) !important;border:1px solid rgba(255,255,255,.14) !important;border-radius:12px !important;
    color:#fff !important;text-align:left !important;font-size:.98rem !important;
  }
  html body:not(.pbody) > header nav#nav.open > a.on,
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-b.on{background:rgba(232,185,67,.18) !important;border-color:rgba(232,185,67,.55) !important}
  html body:not(.pbody) > header nav#nav.open > a span,
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-b span{
    background:none !important;border:0 !important;box-shadow:none !important;padding:0 !important;margin:0 !important;color:#fff !important;text-align:left !important;
  }
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-b .car{margin-left:auto !important;display:inline-flex !important;transition:transform .2s}
  html body:not(.pbody) > header nav#nav.open > .dd.open > .dd-b .car{transform:rotate(180deg)}
  html body:not(.pbody) > header nav#nav.open > .dd{display:block !important;width:100% !important;position:static !important}
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-m{
    display:none !important;position:static !important;transform:none !important;opacity:1 !important;visibility:visible !important;
    width:100% !important;min-width:0 !important;box-sizing:border-box !important;margin:6px 0 0 !important;padding:6px !important;
    background:rgba(255,255,255,.06) !important;border:1px solid rgba(255,255,255,.12) !important;border-radius:12px !important;box-shadow:none !important;
  }
  html body:not(.pbody) > header nav#nav.open > .dd.open > .dd-m{display:flex !important;flex-direction:column !important;gap:4px !important}
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-m a{
    display:flex !important;align-items:center !important;gap:10px !important;padding:11px 12px !important;border-radius:10px !important;
    background:transparent !important;color:#fff !important;text-align:left !important;
  }
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-m a span{color:#fff !important;background:none !important;padding:0 !important}
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-m a svg,
  html body:not(.pbody) > header nav#nav.open > a svg,
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-b svg{color:#f2cf6b !important;stroke:currentColor !important;flex:0 0 auto}
  html body:not(.pbody) > header nav#nav.open > .dd > .dd-m a.on{background:rgba(232,185,67,.18) !important}
}
