/* Phone navigation (see phone-nav.js): a slide-in menu over a dimmed page, and a bottom tab bar with the main pages.
   Colours come from --pn-accent / --pn-ink, set by each app. Desktop and tablets above 760px are unchanged. */
.pn-open-btn,.pn-tabbar,.pn-scrim,.pn-close{display:none}
@media (max-width:760px){
  /* top bar menu button */
  .pn-open-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:0 0 44px;border-radius:14px;
    border:1px solid rgba(20,30,60,.12);background:rgba(255,255,255,.85);color:var(--pn-ink,#14213d);cursor:pointer;padding:0;margin-right:10px}
  .pn-open-btn svg{width:22px;height:22px}
  .pn-open-btn:focus-visible,.pn-tabbar a:focus-visible,.pn-tabbar button:focus-visible,.pn-close:focus-visible{outline:3px solid var(--pn-accent,#0c8b91);outline-offset:2px}

  /* the menu: off-screen on the left until opened (styled from the first paint, so the page never jumps when the script loads) */
  [data-pn-drawer]{position:fixed!important;top:0!important;bottom:0!important;left:0!important;right:auto!important;
    width:min(86vw,340px)!important;max-width:none!important;height:100%!important;height:100dvh!important;margin:0!important;
    border-radius:0 24px 24px 0!important;z-index:2400!important;display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;
    gap:0!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
    padding:calc(14px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left))!important;
    transform:translateX(-104%);visibility:hidden;transition:transform .26s cubic-bezier(.2,.8,.2,1),visibility 0s linear .26s;
    box-shadow:0 20px 60px rgba(0,0,0,.35)}
  html.pn-open [data-pn-drawer]{transform:none;visibility:visible;transition:transform .26s cubic-bezier(.2,.8,.2,1)}
  [data-pn-drawer] nav{display:block!important;flex:1 0 auto!important;max-height:none!important;overflow:visible!important;margin:6px 0 0!important;padding:0!important}
  [data-pn-drawer] nav a{display:flex!important;align-items:center;gap:8px;min-height:46px;white-space:normal!important;padding:11px 12px!important;
    border-radius:12px;font-size:15.5px!important;line-height:1.3}
  [data-pn-drawer] nav a[hidden]{display:none!important}
  [data-pn-drawer] nav details[hidden]{display:none!important}
  [data-pn-drawer]>*{flex-shrink:0!important}
  [data-pn-drawer] .brand{padding-right:48px;min-height:44px;height:auto!important}
  [data-pn-drawer] .sidebar-foot,[data-pn-drawer] .sidebar-bottom{display:block!important;margin-top:14px}
  [data-pn-drawer] .nav-toggle{display:none!important}
  .pn-close{display:grid;position:absolute;top:calc(12px + env(safe-area-inset-top));right:12px;width:40px;height:40px;border-radius:12px;border:0;
    background:rgba(255,255,255,.14);color:#fff;font-size:26px;line-height:1;cursor:pointer;display:grid;place-items:center;z-index:1}
  .pn-filter{margin:12px 0 4px}
  [data-pn-drawer] .pn-filter input{width:100%;min-height:44px;border-radius:12px!important;border:1px solid rgba(255,255,255,.34)!important;
    background:rgba(0,0,0,.22)!important;color:#fff!important;padding:9px 12px!important;font-size:16px!important;box-shadow:none!important}
  [data-pn-drawer] .pn-filter input::placeholder{color:rgba(255,255,255,.82)!important;opacity:1}
  [data-pn-drawer] .pn-filter input:focus{outline:2px solid rgba(255,255,255,.7);outline-offset:1px}
  .pn-scrim{display:block;position:fixed;inset:0;background:rgba(8,12,28,.48);opacity:0;pointer-events:none;transition:opacity .22s;z-index:2390}
  html.pn-open .pn-scrim{opacity:1;pointer-events:auto}
  html.pn-open,html.pn-open body{overflow:hidden!important}

  /* bottom tab bar: the main pages for this person's role, always visible */
  .pn-tabbar{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);position:fixed;left:10px;right:10px;bottom:calc(8px + env(safe-area-inset-bottom));
    z-index:1500;padding:6px;border-radius:22px;background:rgba(255,255,255,.92);-webkit-backdrop-filter:blur(18px) saturate(1.4);backdrop-filter:blur(18px) saturate(1.4);
    border:1px solid rgba(20,30,60,.10);box-shadow:0 12px 34px rgba(20,30,60,.18)}
  .pn-tabbar a,.pn-tabbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:52px;padding:4px 2px;border:0;
    background:none;border-radius:16px;color:var(--pn-ink,#14213d)!important;text-decoration:none!important;font-family:inherit;font-weight:600;font-size:11.5px;line-height:1.15;letter-spacing:.01em;cursor:pointer;position:relative;min-width:0}
  .pn-tabbar svg{width:23px;height:23px}
  .pn-tabbar span{font-size:inherit;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .pn-tabbar [aria-current="page"]{color:var(--pn-accent,#0c8b91)!important;background:color-mix(in srgb,var(--pn-accent,#0c8b91) 12%,transparent)}
  .pn-tabbar .pn-badge{position:absolute;top:3px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#d63c3c;color:#fff;font-size:11px;line-height:18px;text-align:center}
  body:has(.pn-tabbar){padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  body:has(.pn-tabbar) #helpbot{bottom:calc(86px + env(safe-area-inset-bottom))!important}
  body:has(.pn-tabbar) #helpbot .hb-panel{bottom:calc(152px + env(safe-area-inset-bottom))!important;height:min(52vh,460px);height:min(52dvh,460px);max-height:calc(100dvh - 200px)}
  body:has(.pn-tabbar) #helpbot.hb-kb .hb-panel{bottom:auto!important}
  html.pn-open #helpbot{visibility:hidden}

  /* dark mode */
  html[data-theme=dark] .pn-tabbar{background:rgba(18,24,40,.92);border-color:rgba(255,255,255,.10);box-shadow:0 12px 34px rgba(0,0,0,.5)}
  html[data-theme=dark] .pn-tabbar a,html[data-theme=dark] .pn-tabbar button{color:#e7ecf5!important}
  html[data-theme=dark] .pn-tabbar [aria-current="page"]{color:var(--pn-accent-dark,#5fd3d6)!important;background:rgba(255,255,255,.08)}
  html[data-theme=dark] .pn-open-btn{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.16);color:#e7ecf5}
}
@media (max-width:760px) and (prefers-reduced-motion:reduce){[data-pn-drawer],.pn-scrim{transition:none!important}}
@media print{.pn-tabbar,.pn-open-btn,.pn-scrim{display:none!important}body{padding-bottom:0!important}}
