/* v72.94: the side menu folds to icons on desktop and opens while the pointer is on it (js/side-rail.js).
   Only on screens with a mouse or trackpad, 901px and wider. Tablets and phones keep the menu they have.
   Everything stays in the same place when it opens: icons don't move, the words fade in beside them,
   and the open menu lies over the page, so the page never jumps. The page centers in the space next to the icons. */
@media screen and (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .jjs-shell { --sr-w: 72px; --sr-open: 252px; --sr-ease: cubic-bezier(.2, .7, .3, 1); }

  /* the menu: 72px of icons; open, 252px over the page (the negative margin keeps the page where it is) */
  .jjs-shell > .jjs-side {
    width: var(--sr-w); margin-right: 0; padding: 14px 12px 12px; gap: 10px;
    overflow: hidden;
    transition: width .22s var(--sr-ease), margin-right .22s var(--sr-ease), box-shadow .22s ease;
  }
  .jjs-shell > .jjs-side.sr-open {
    width: var(--sr-open); margin-right: calc(var(--sr-w) - var(--sr-open));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 28px 70px rgba(0, 0, 0, .34);
  }

  /* words that show only when it is open */
  .jjs-side .jjs-brandmark-text, .jjs-side .jjs-sub, .jjs-side .v2-newbtn > span,
  .jjs-side .jjs-navitem > span:not(.jjs-navbadge), .jjs-side .jjs-navbadge:not(.hot):not(.bad), .jjs-side .v2-who-txt {
    white-space: nowrap; opacity: 0; transition: opacity .1s ease;
  }
  .jjs-side.sr-open .jjs-brandmark-text, .jjs-side.sr-open .jjs-sub, .jjs-side.sr-open .v2-newbtn > span,
  .jjs-side.sr-open .jjs-navitem > span:not(.jjs-navbadge), .jjs-side.sr-open .jjs-navbadge:not(.hot):not(.bad), .jjs-side.sr-open .v2-who-txt {
    opacity: 1; transition: opacity .18s ease .07s;
  }
  /* parts you can click are out of reach while folded (no clicking or tabbing into what you can't see) */
  .jjs-side .v2-who-row > *, .jjs-side .jjs-side-note {
    opacity: 0; visibility: hidden; transition: opacity .1s ease, visibility 0s linear .1s;
  }
  .jjs-side.sr-open .v2-who-row > *, .jjs-side.sr-open .jjs-side-note {
    opacity: 1; visibility: visible; transition: opacity .18s ease .07s, visibility 0s;
  }
  /* Clients: only in the open menu (folded, they take no room, so short screens still fit every icon) */
  .jjs-side:not(.sr-open) .jjs-side-section, .jjs-side:not(.sr-open) .jjs-clientlist { display: none !important; }
  .jjs-side.sr-open .jjs-side-section, .jjs-side.sr-open .jjs-clientlist { animation: sr-in .2s ease .05s both; }
  .jjs-side .jjs-side-section, .jjs-side .jjs-clientbtn { white-space: nowrap; }

  /* logo: the J stays put; the name fades in beside it */
  .jjs-side .jjs-brand { padding: 4px 0 2px 14px; }
  .jjs-side .jjs-brand-text { min-width: 0; }
  .jjs-side .jjs-sub { overflow: hidden; }

  /* New: a round + when folded, the full button when open */
  .jjs-side .jjs-newwrap { padding: 0; }
  .jjs-side .v2-newbtn { justify-content: flex-start; padding: 11px 15px; gap: 10px; min-height: 44px; overflow: hidden; white-space: nowrap; }
  .jjs-side .v2-newbtn .jjs-ico { width: 16px; height: 16px; flex: none; }

  /* places: the icon sits in the middle of the folded menu, the word beside it */
  .jjs-side .jjs-navitem { position: relative; padding: 8px 10px 8px 14px; gap: 12px; overflow: visible; }
  .jjs-side .jjs-navitem > .jjs-ico { flex: none; }
  .jjs-side .jjs-navitem > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }

  /* new things (red count): on the icon's corner when folded, at the end of the row when open */
  .jjs-side .jjs-navitem > .jjs-navbadge.hot, .jjs-side .jjs-navitem > .jjs-navbadge.bad {
    position: absolute; top: 3px; left: 25px; transform: translateX(0);
    min-width: 17px; height: 17px; padding: 0 5px; box-sizing: border-box; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; line-height: 1;
    box-shadow: 0 0 0 2px rgba(14, 14, 16, .9);
    transition: left .22s var(--sr-ease), top .22s var(--sr-ease), transform .22s var(--sr-ease), box-shadow .22s ease;
  }
  .jjs-side.sr-open .jjs-navitem > .jjs-navbadge.hot, .jjs-side.sr-open .jjs-navitem > .jjs-navbadge.bad {
    top: 50%; left: calc(100% - 10px); transform: translate(-100%, -50%); box-shadow: none;
  }
  .jjs-side .jjs-navitem > .jjs-navbadge.hot[hidden], .jjs-side .jjs-navitem > .jjs-navbadge.bad[hidden] { display: none !important; }

  /* Admin: a short line when folded, the word when open */
  .jjs-side .op-navsec {
    padding-top: 10px; padding-bottom: 4px;
    background: linear-gradient(rgba(255, 255, 255, .2), rgba(255, 255, 255, .2)) no-repeat 11px calc(50% + 3px) / 24px 1px;
    white-space: nowrap; transition: color .1s ease, background-size .18s ease;
  }
  .jjs-side:not(.sr-open) .op-navsec { color: transparent; }
  .jjs-side.sr-open .op-navsec { background-size: 0 1px; transition: color .18s ease .07s, background-size .18s ease; }

  /* the middle (places, then clients) scrolls by itself; logo, New, Settings and your account always show */
  .jjs-side .sr-mid {
    display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0;
    overflow-x: hidden; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
    margin: 0 -12px; padding: 0 12px; /* scrollbar at the menu's edge, not over the icons */
  }
  /* a soft fade at the bottom edge, only while there is more to scroll (short screens, long client lists) */
  .jjs-side .sr-mid.sr-more { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 22px), transparent); }
  .jjs-side .sr-mid::-webkit-scrollbar { width: 0; height: 0; }
  .jjs-side.sr-open .sr-mid { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
  .jjs-side.sr-open .sr-mid::-webkit-scrollbar { width: 6px; }
  .jjs-side.sr-open .sr-mid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }
  .jjs-side .jjs-sidefoot { flex: none; padding-top: 8px; padding-bottom: 2px; }

  /* bottom: Settings and Client view as places (icons when folded), then the connection light and your account */
  .jjs-side .jjs-sidefoot .op-footbtns { order: -1; flex-direction: column; gap: 2px; padding: 0 0 4px; }
  .jjs-side .jjs-sidefoot .op-footbtns > .jjs-navitem.op-footbtn {
    width: 100%; flex: none; justify-content: flex-start; height: auto; gap: 12px; padding: 8px 10px 8px 14px;
    border: 0; border-radius: 12px; background: transparent; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .72);
  }
  .jjs-side .jjs-sidefoot .op-footbtns > .jjs-navitem.op-footbtn .jjs-ico { width: 18px; height: 18px; color: rgba(255, 255, 255, .6); }
  .jjs-side .jjs-sidefoot .op-footbtns > .jjs-navitem.op-footbtn:not(.on):hover { background: rgba(255, 255, 255, .1); }
  .jjs-side .jjs-sidefoot .op-footbtns > .jjs-navitem.op-footbtn.on { background: rgba(255, 255, 255, .88); color: var(--black); font-weight: 700; }
  .jjs-side .jjs-sidefoot .op-footbtns > .jjs-navitem.op-footbtn.on .jjs-ico { color: var(--black); }
  .jjs-side .jjs-syncbadge { padding: 6px 0 0 19px; gap: 10px; white-space: nowrap; min-height: 22px; transition: color .18s ease .07s; }
  .jjs-side:not(.sr-open) .jjs-syncbadge { color: transparent; transition: color .1s ease; } /* the light stays; the words come back when open */
  .jjs-side .jjs-syncbadge .dot { flex: none; }
  /* your account: picture, email and name; then role, Sign out and Change password on one line */
  /* the account block and the note keep the open menu's width when folded, so nothing in them moves on opening */
  .jjs-side .v2-whoami, .jjs-side .jjs-side-note { width: calc(var(--sr-open) - 24px); flex: none; box-sizing: border-box; }
  .jjs-side .jjs-side-note { width: calc(var(--sr-open) - 44px); }
  .jjs-side .v2-whoami { padding: 2px 0 0; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; }
  .jjs-side .v2-who-main { padding: 6px 6px 6px 7px; flex: 0 0 100%; }
  .jjs-side .v2-who-row { display: contents; }
  .jjs-side .v2-who-row > * { white-space: nowrap; }
  .jjs-side .v2-whoami > .v2-who-row:first-of-type > :first-child { margin-left: 2px; }
  .jjs-side .v2-whoami .v2-who-row .jjs-linktext { font-size: 11px; }
  .jjs-side .v2-whoami .v2-who-row .sx-pwlink { margin-left: 0; }

  /* the page: same space on both sides, centered next to the icons */
  .jjs-shell > .jjs-side ~ .jjs-main .jjs-main-inner { padding-left: 32px; }
  .jjs-shell > .jjs-side ~ .jjs-main .jjs-topbar-in { padding-left: 32px; }
}
@keyframes sr-in { from { opacity: 0; } to { opacity: 1; } }
/* tablets, phones and touch screens: the middle wrapper changes nothing */
@media not screen and (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .jjs-side .sr-mid { display: contents; }
}
