:root { --portal-sidebar-width: 84px; }

body.portal-menu-expanded { --portal-sidebar-width: 190px; }

.portal-sidebar {
  padding: 24px 10px 20px;
  gap: 28px;
  transition: width .2s ease, padding .2s ease;
}

.portal-brand { justify-content: center; }
.portal-brand strong,
.portal-sidebar > small,
.portal-nav-item strong {
  width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: opacity .15s ease;
}

.portal-menu-expanded .portal-brand { justify-content: flex-start; }
.portal-menu-expanded .portal-brand strong,
.portal-menu-expanded .portal-sidebar > small,
.portal-menu-expanded .portal-nav-item strong {
  width: auto;
  overflow: visible;
  opacity: 1;
}

.portal-menu-toggle {
  position: absolute;
  top: 26px;
  right: -15px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #f4f2ea;
  border-radius: 50%;
  background: #e8efb9;
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px #08291e45;
}

.portal-menu-toggle span { transform: none; }
.portal-menu-expanded .portal-menu-toggle span { transform: none; }

.portal-sidebar nav {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.portal-nav-item {
  min-height: 72px;
  height: 72px;
  flex: 0 0 72px;
  justify-content: center;
  padding: 10px;
  gap: 11px;
}

.portal-menu-expanded .portal-nav-item { justify-content: flex-start; padding-inline: 14px; }

.portal-nav-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
}

body.portal-active .portal-header,
body.portal-active main { transition: margin-left .2s ease, width .2s ease; }

@media (max-width: 900px) {
  :root { --portal-sidebar-width: 76px; }
  body.portal-menu-expanded { --portal-sidebar-width: 168px; }
  .portal-sidebar { padding-inline: 8px; }
  .portal-nav-item { min-height: 68px; height: 68px; flex-basis: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-sidebar,
  .portal-menu-toggle span,
  body.portal-active .portal-header,
  body.portal-active main { transition: none; }
}
