.shell {
  display: grid;
  grid-template-columns: calc(var(--sidebar-w) + var(--inset)) minmax(0, 1fr);
  height: 100%;
}

/* Floating glass sidebar, inset from the window edges */
.shell-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  margin: var(--inset) 0 var(--inset) var(--inset);
  padding: 14px 12px 12px;
  border-radius: var(--r-2xl);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-edge), var(--shadow-2);
  overflow-y: auto;
  animation: slide-in-left var(--d-slow) var(--ease-out);
}
@keyframes slide-in-left {
  from {
    transform: translateX(-14px);
    opacity: 0;
  }
}
@keyframes slide-in-right {
  from {
    transform: translateX(14px);
    opacity: 0;
  }
}

.shell-brand {
  height: 40px;
  padding: 0 8px;
  margin-bottom: 12px;
}

.shell-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shell-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--r-md);
  color: var(--label-2);
  font: 600 14px/1 var(--font);
  transition: background var(--d-fast), color var(--d-fast), transform var(--d) var(--spring);
}
.shell-nav-item .icon {
  width: 19px;
  height: 19px;
  color: var(--label-3);
  transition: color var(--d-fast), transform var(--d) var(--spring);
}
.shell-nav-item:hover {
  background: var(--hover);
  color: var(--label);
}
.shell-nav-item:hover .icon {
  transform: scale(1.1);
}
.shell-nav-item:active {
  transform: scale(0.97);
}
.shell-nav-item.is-active {
  background: var(--bg-elevated);
  color: var(--label);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.06), inset 0 0 0 0.5px var(--separator);
}
.shell-nav-item.is-active .icon {
  color: var(--brand);
}
.shell-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--vibe-gradient);
}

.shell-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.shell-section-title {
  padding: 0 11px 7px;
  font: 650 11px/1 var(--font);
  letter-spacing: 0.04em;
  color: var(--label-3);
}
.shell-recent {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  font: 500 13px/1 var(--font);
  color: var(--label-2);
  transition: background var(--d-fast), color var(--d-fast);
}
.shell-recent span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-recent:hover {
  background: var(--hover);
  color: var(--label);
}
.shell-recent-dot {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  flex: none;
  background: linear-gradient(140deg, hsl(var(--h) 80% 70%), hsl(calc(var(--h) + 40) 70% 52%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.shell-mock {
  margin: 0 4px 8px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: var(--fill-4);
  box-shadow: inset 0 0 0 0.5px var(--separator);
  font: 500 11px/1.3 var(--font);
  color: var(--label-3);
  text-align: center;
}

.shell-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 0.5px solid var(--separator);
}
.shell-foot--anon {
  border-top: 0;
  gap: 4px;
}
.shell-credits {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border-radius: var(--r-md);
  font: 700 13.5px/1 var(--font-round);
  transition: background var(--d-fast);
}
.shell-credits .icon {
  color: var(--orange);
  fill: currentColor;
  stroke: none;
}
.shell-credits:hover {
  background: var(--hover);
}
.shell-account {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--r-lg);
  text-align: left;
  transition: background var(--d-fast);
}
.shell-account:hover,
.shell-account.is-on {
  background: var(--hover);
}
.shell-account-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.shell-account-text strong {
  font: 650 13.5px/1.2 var(--font);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-account-text small {
  font: var(--t-caption);
  color: var(--label-3);
}

.shell-main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}
.shell-main > * {
  animation: page-in var(--d-slow) var(--ease-out);
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.shell-tabbar {
  display: none;
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .shell-sidebar {
    display: none;
  }
  .shell-tabbar {
    display: flex;
    justify-content: space-around;
    margin: 0 12px calc(10px + env(safe-area-inset-bottom));
    padding: 6px;
    border-radius: var(--r-full);
    background: var(--glass-strong);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-edge), var(--shadow-3);
  }
  .shell-tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    border-radius: var(--r-full);
    font: 600 10.5px/1 var(--font);
    color: var(--label-3);
    transition: background var(--d-fast), color var(--d-fast);
  }
  .shell-tabbar a.is-active {
    color: var(--brand);
    background: var(--brand-soft);
  }
  .shell-tabbar .icon {
    width: 22px;
    height: 22px;
  }
}
