/* OFFSCRPT tab bar: Home, Search, Glance, Adda, Incidents, Me.
   Phones: a floating dark pill at the foot of every page. Computers: on the app pages it becomes a sidebar on the left,
   the way Instagram's is (icons only on mid-width screens, icons and names on wide ones); elsewhere it hides. */
:root{--tabs:0px;--side:0px}
.tabbar{display:none}
.tabbar .tb-logo,.tabbar .tb-gap,.tabbar .tb-x{display:none}
@media (max-width:700px){
  :root{--tabs:calc(82px + env(safe-area-inset-bottom))}
  body{padding-bottom:var(--tabs)}
  .tabbar{position:fixed;z-index:60;left:50%;bottom:calc(12px + env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:1px;padding:5px;border-radius:999px;background:rgba(22,20,20,.8);backdrop-filter:blur(18px) saturate(1.5);-webkit-backdrop-filter:blur(18px) saturate(1.5);border:1px solid rgba(255,255,255,.1);box-shadow:0 18px 40px -12px rgba(0,0,0,.55)}
  .tabbar a{position:relative;width:min(48px,calc((100vw - 44px) / 7));height:48px;border-radius:999px;display:grid;place-items:center;color:rgba(255,255,255,.72);text-decoration:none;-webkit-tap-highlight-color:transparent;transition:color .2s,background .25s}
  .tabbar a span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .tabbar a[aria-current=page]{background:#fff;color:#111;box-shadow:0 4px 14px rgba(0,0,0,.25)}
  .tabbar svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
  .tabbar a:active svg{transform:scale(.86)}
  .tabbar a[aria-current=page] svg{stroke-width:2.1}
  /* things that float at the foot of a page sit above the bar */
  .dock{bottom:calc(10px + var(--tabs))}
  html.reading .tabbar,html.sheet-open .tabbar{display:none}
}

/* computers: the sidebar */
@media (min-width:701px){
  body.ap,body.rl-page{--side:76px;padding-left:var(--side)}
  body.ap .tabbar,body.rl-page .tabbar{position:fixed;z-index:60;top:0;left:0;bottom:0;width:var(--side);display:flex;flex-direction:column;gap:4px;padding:22px 12px 18px;border-right:1px solid var(--sb-line,rgba(127,127,127,.2));background:var(--sb-bg,#fff)}
  body.ap .tabbar{--sb-bg:var(--ap-bg);--sb-line:var(--ap-line);--sb-ink:var(--ap-ink);--sb-hover:var(--ap-chip)}
  body.rl-page .tabbar{--sb-bg:#000;--sb-line:rgba(255,255,255,.12);--sb-ink:#fff;--sb-hover:rgba(255,255,255,.1)}
  .tabbar a{display:flex;align-items:center;gap:16px;height:50px;padding:0 13px;border-radius:12px;color:var(--sb-ink);text-decoration:none;font:400 15.5px/1 var(--ui);transition:background .15s}
  .tabbar a:hover{background:var(--sb-hover)}
  .tabbar a svg{flex:none;width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
  .tabbar a:hover svg{transform:scale(1.06)}
  .tabbar a[aria-current=page]{font-weight:700}
  .tabbar a[aria-current=page] svg{stroke-width:2.4}
  .tabbar a span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .tabbar .tb-logo{display:flex;height:64px;margin-bottom:14px;padding:0 13px}
  .tabbar .tb-logo:hover{background:none}
  .tabbar .tb-logo img{display:none}
  .tabbar .tb-logo .tb-mark{display:block;width:26px;height:26px;border-radius:7px}
  .tabbar .tb-gap{display:block;flex:1}
  .tabbar .tb-x{display:flex}
  body.ap .tb-logo img:first-child{filter:var(--sb-logo,none)}
}
@media (min-width:1264px){
  body.ap,body.rl-page{--side:244px}
  .tabbar a span{position:static;width:auto;height:auto;overflow:visible;clip:auto}
  .tabbar .tb-logo img:first-child{display:block;height:22px;width:auto;margin-top:8px}
  .tabbar .tb-logo .tb-mark{display:none}
  body.ap .tabbar{--sb-logo:invert(1)}
}
@media (min-width:1264px) and (prefers-color-scheme:dark){:root:not([data-theme=light]) body.ap .tabbar{--sb-logo:none}}
@media (min-width:1264px){:root[data-theme=dark] body.ap .tabbar{--sb-logo:none}}

/* ===================== phones: four tabs and a + in the middle; detail pages have no tab bar ===================== */
.tabbar .tb-plus{display:none}
@media (max-width:700px){
  .tabbar{gap:4px;padding:6px}
  .tabbar .tb-wide,.tabbar .tb-bell{display:none!important}
  .tabbar a{width:52px;height:52px;max-height:none;aspect-ratio:auto}
  .tabbar .tb-home{order:1}.tabbar .tb-glance{order:2}.tabbar .tb-plus{order:3}.tabbar .tb-tea{order:4}.tabbar .tb-spot{order:5}
  .tabbar .tb-plus{display:grid;place-items:center;width:58px;height:52px;margin:0 4px;border:0;border-radius:18px;background:#fff;color:#111;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.3);-webkit-tap-highlight-color:transparent}
  .tabbar .tb-plus svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2.4;stroke-linecap:round}
  .tabbar .tb-plus span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .tabbar .tb-plus:active{transform:scale(.94)}
  .tabbar a[aria-current=page]{background:rgba(255,255,255,.16);color:#fff;box-shadow:none}
  body.dt{--tabs:0px;padding-bottom:0}
  body.dt .tabbar{display:none}
}
@media (max-width:360px){.tabbar a{width:46px;height:48px}.tabbar .tb-plus{width:52px;height:48px}}
/* computers: the + is a "Create" button in the sidebar */
@media (min-width:701px){
  body.ap .tabbar .tb-plus,body.rl-page .tabbar .tb-plus{display:flex;align-items:center;gap:16px;height:50px;margin-top:8px;padding:0 13px;border:0;border-radius:12px;background:var(--sb-ink);color:var(--sb-bg);font:600 15px/1 var(--ui);cursor:pointer}
  .tabbar .tb-plus svg{flex:none;width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round}
  .tabbar .tb-plus span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
}
@media (min-width:1264px){.tabbar .tb-plus span{position:static;width:auto;height:auto;overflow:visible;clip:auto}}

/* six tabs and the +: everything shrinks evenly to fit the phone */
@media (max-width:700px){
  .tabbar{gap:2px;padding:5px;max-width:calc(100vw - 16px)}
  .tabbar a{width:min(46px,calc((100vw - 16px - 10px - 56px - 14px) / 6));height:48px}
  .tabbar svg{width:21px}
  .tabbar .tb-home{order:1}.tabbar .tb-glance{order:2}.tabbar .tb-paper{order:3}.tabbar .tb-plus{order:4}.tabbar .tb-incidents{order:5}.tabbar .tb-tea{order:6}.tabbar .tb-spot{order:7}
  .tabbar .tb-plus{width:52px;height:48px;margin:0 3px;border-radius:16px}
}
@media (max-width:340px){.tabbar svg{width:19px}.tabbar .tb-plus{width:46px}}

/* inside the OFFSCRPT app: the app has its own native tab bar */
html.in-app{--tabs:0px!important}
html.in-app .tabbar{display:none!important}
html.in-app body{padding-bottom:0!important}
html.in-app body.ap,html.in-app body.rl-page{--side:0px!important;padding-left:0!important}
html.in-app .ap-top{display:grid!important}
html.in-app .rl-top,html.in-app .rl-under,html.in-app .rl-hint{left:50%!important}
