/* One navigation surface: operational pages above, account controls below. */
.portal-shell .portal-sidebar { overflow: visible; }
.portal-shell .portal-sidebar__header { flex-shrink: 0; }
.portal-shell .portal-navigation { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.portal-shell .portal-main { min-height: 100dvh; }
.portal-shell .portal-sidebar__footer {
  display: block;
  position: relative;
  flex-shrink: 0;
  margin-top: auto;
  padding: .75rem .65rem max(.75rem, env(safe-area-inset-bottom));
}
.portal-account > summary {
  gap: .6rem;
  min-height: 3.5rem;
  padding: .5rem .6rem;
  color: var(--ev-text);
  border-radius: .875rem;
}
.portal-account > summary:focus-visible { outline: 2px solid var(--ev-primary); outline-offset: 2px; }
.portal-account > summary:hover,
.portal-account[open] > summary { background: var(--ev-primary-soft); }
.portal-account__avatar {
  display: inline-grid;
  flex: 0 0 2.1rem;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--ev-primary);
  color: white;
  font-size: .8125rem;
  font-weight: 500;
}
.portal-account__identity { display: grid; flex: 1; min-width: 0; gap: .15rem; }
.portal-account__identity strong,
.portal-account__identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-account__identity strong { font-size: .75rem; font-weight: 500; }
.portal-account__identity small { color: var(--ev-text-muted); font-size: .6875rem; }
.portal-account > summary > .portal-account__chevron { display: block; margin: 0; flex-shrink: 0; }
.portal-account[open] .portal-account__chevron { transform: rotate(180deg); }
.portal-account-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 1.25rem;
  padding: .1rem .35rem;
  border-radius: 1rem;
  background: #b42335;
  color: white;
  font-size: .625rem;
  font-weight: 500;
  line-height: 1.5;
}
.portal-account__panel {
  position: absolute;
  z-index: 1100;
  left: 0;
  bottom: calc(100% + .6rem);
  width: 20rem;
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100dvh - 6.5rem - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  color: var(--ev-text);
  background: white;
  border: 1px solid var(--ev-border);
  border-radius: 1.1rem;
  box-shadow: 0 12px 44px #172b4324, 0 2px 6px #172b4308;
}
.portal-account__heading { display: flex; gap: .75rem; align-items: center; padding: 1rem; }
.portal-account__heading > div { min-width: 0; }
.portal-account__heading strong,
.portal-account__heading small { display: block; overflow-wrap: anywhere; }
.portal-account__heading strong { font-size: .8125rem; font-weight: 500; }
.portal-account__heading small { font-size: .6875rem; color: var(--ev-text-muted); margin-top: .15rem; }
.portal-account__switcher { display: flex; gap: .4rem; margin: 0 1rem .5rem; }
.portal-account__switcher .form-select { min-width: 0; font-size: .75rem; }
.portal-account__switcher .btn { flex-shrink: 0; font-size: .6875rem; min-height: 2.75rem; }
.portal-account__links { padding: .5rem; }
.portal-account__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .6rem .65rem;
  color: var(--ev-text);
  background: transparent;
  border: 0;
  border-radius: .65rem;
  text-decoration: none;
  text-align: left;
  font-size: .75rem;
  font-weight: 400;
}
.portal-account__link > span:first-of-type { flex: 1; }
.portal-account__link:hover,
.portal-account__link.is-active { background: var(--ev-primary-soft); color: var(--ev-primary); }
.portal-account__icon { width: 1.15rem; height: 1.15rem; flex-shrink: 0; stroke-width: 1.6; }
.portal-account__logout { padding: .4rem .5rem; border-top: 1px solid var(--ev-border); }
.portal-account__logout .portal-account__link { color: #a12e3d; }
.portal-account__logout .portal-account__link:hover { background: #fff3f4; }
.portal-mobile-navigation { display: none; }

@media (min-width: 62rem) {
  .portal-sidebar-collapsed .portal-shell .portal-sidebar__footer {
    position: relative; width: auto; height: auto; overflow: visible; clip: auto;
    white-space: normal; border-top: 1px solid var(--ev-border); padding: .75rem .5rem;
  }
  .portal-sidebar-collapsed .portal-account > summary { justify-content: center; padding: .5rem; position: relative; }
  .portal-sidebar-collapsed .portal-account__identity,
  .portal-sidebar-collapsed .portal-account > summary > .portal-account__chevron { display: none; }
  .portal-sidebar-collapsed .portal-account > summary > .portal-account-badge { position: absolute; right: 0; top: 0; }
  .portal-sidebar-collapsed .portal-shell .portal-sidebar__collapse { color: var(--ev-text-muted); }
  .portal-sidebar-collapsed .portal-shell .portal-navigation { padding-top: 3.5rem; }
}
@media (max-width: 61.99rem) {
  .portal-account__panel { width: 100%; }
  .portal-account__switcher { flex-wrap: wrap; }
  .portal-account__switcher .form-select { font-size: 1rem; flex-basis: 100%; }
  .portal-account__switcher .btn { margin-left: auto; }
  .portal-shell .portal-sidebar__header { padding-top: env(safe-area-inset-top); }
  .portal-mobile-navigation {
    display: inline-flex; align-items: center; gap: .5rem;
    min-height: 2.75rem; padding: .45rem .85rem; margin-bottom: 1.25rem;
    color: var(--ev-primary); background: #fff; border: 1px solid var(--ev-border);
    border-radius: 2rem; font-size: .75rem;
  }
  .portal-mobile-navigation svg { width: 1.15rem; height: 1.15rem; }
}
@media print {
  .portal-mobile-navigation { display: none; }
}
