/* Shared navigation and workspace frame. */
.has-shell {
  --sidebar-w: 14rem;
  --workspace-ink: #191833;
  --workspace-paper: #f7f6f1;
  --workspace-rule: #e4e0d8;
  --sidebar-text: #d0cde1;
  --sidebar-active: #34314d;
  --sidebar-accent: #ff987e;
  background: var(--workspace-paper);
}

.has-shell .sidebar {
  height: 100dvh;
  padding: 1.35rem .9rem 1rem;
  gap: 1.8rem;
  background: var(--workspace-ink);
  border: 0;
  color: var(--sidebar-text);
}

.has-shell .sidebar :focus-visible {
  outline-color: var(--sidebar-accent);
  outline-offset: -2px;
}

.sb-head { padding: 0 .35rem; }
.has-shell .brand { gap: .65rem; color: #fff; letter-spacing: -.025em; }
.has-shell .brand-mark {
  width: 2.05rem;
  height: 2.05rem;
  background: #fbdecf;
  color: var(--workspace-ink);
  border-radius: .6rem;
}
.brand-mark .ico { width: 1.15rem; height: 1.15rem; }

.has-shell .sidenav { gap: .6rem; flex: 1; }

.sidenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .18rem;
}

.sidenav .navlink {
  position: relative;
  gap: .72rem;
  min-height: 2.6rem;
  padding: .48rem .75rem;
  color: var(--sidebar-text);
  line-height: 1.25;
  border-radius: .6rem;
}

.sidenav .navlink:hover,
.sidenav .navlink[aria-current] {
  color: #fff;
  background: var(--sidebar-active);
}

.sidenav .navlink[aria-current] { font-weight: 600; }

.sidenav .navlink[aria-current]::before {
  position: absolute;
  inset: .65rem auto .65rem 0;
  width: 3px;
  border-radius: 2px;
  background: var(--sidebar-accent);
  content: "";
}

.sidenav .navlink[aria-current] > .ico { color: var(--sidebar-accent); }

.nav-more { padding-top: .6rem; border-top: 1px solid #393650; }
.nav-more summary { list-style: none; cursor: pointer; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary .go { margin-left: auto; color: currentColor; }
.nav-more[open] summary .go { transform: rotate(90deg); }
.sidenav .nav-more ul { margin: .22rem 0 0 1.1rem; padding-inline-start: .55rem; border-inline-start: 1px solid #534d6b; }
.nav-more li .navlink { min-height: 2.1rem; font-size: .8125rem; }
.nav-utility { margin-top: auto; padding-top: .65rem; border-top: 1px solid #393650; }

.has-shell .topbar {
  min-height: 4.1rem;
  padding: .45rem clamp(1rem, 3.1vw, 3.25rem);
  border-color: var(--workspace-rule);
  background: var(--workspace-paper);
}

.topbar-context {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--workspace-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.has-shell .search-chip {
  gap: .5rem;
  border-color: var(--workspace-rule);
  border-radius: .6rem;
  background: #fffdfa;
  color: #4e4b61;
}

.has-shell .search-chip:hover { border-color: #aaa5b3; }
.has-shell .search-chip kbd { margin-left: 1.25rem; color: #5b566b; }

.has-shell .profile { min-width: 0; max-width: 36%; }
.has-shell .profile > summary { gap: .52rem; padding: .2rem; min-height: 2.35rem; }
.has-shell .avatar { width: 2rem; height: 2rem; flex: none; background: #e9e5f2; color: #423b64; }
.has-shell .profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn.sb-close, .icon-btn.nav-toggle { display: none; }
.js .icon-btn.nav-toggle {
  display: inline-grid;
  flex: none;
  background: transparent;
  border-color: transparent;
  color: var(--workspace-ink);
}
.js .icon-btn.nav-toggle:hover { background: #ebe7e0; }
.has-shell .scrim { background: rgb(25 24 51 / .47); }

@media (max-width: 61.99rem) {
  .has-shell .sidebar {
    position: static;
    width: auto;
    height: auto;
    transform: none;
    box-shadow: none;
  }

  .js .has-shell .sidebar {
    position: fixed;
    width: min(19rem, 86vw);
    height: 100dvh;
    transform: translateX(-102%);
    visibility: hidden;
  }

  .js .has-shell.nav-open { overflow: hidden; }
  .js .has-shell.nav-open .sidebar { transform: none; visibility: visible; }

  .js .icon-btn.sb-close {
    display: inline-grid;
    flex: none;
    background: transparent;
    border: 0;
    color: var(--sidebar-text);
  }

  .js .icon-btn.sb-close:hover { background: var(--sidebar-active); }
  .sidenav .navlink, .nav-more li .navlink { min-height: 2.75rem; }
  .js .icon-btn.nav-toggle, .js .icon-btn.sb-close { width: 2.75rem; height: 2.75rem; }
}

@media (max-width: 36rem) {
  .has-shell .topbar { min-height: 3.65rem; padding-inline: .6rem .85rem; gap: .45rem; }
  .has-shell .search-chip, .has-shell .profile > summary { min-height: 2.75rem; min-width: 2.75rem; }
  .has-shell .profile > summary { justify-content: center; }
}
