:root {
  --header-height: 76px;
  --radius-panel: 16px;
  --line-hover: #cdd0d6;
}
.portal-topbar {
  display: flex;
  min-height: calc(var(--header-height) - 1px);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
}
.site-header:has(.portal-topbar) {
  height: var(--header-height);
  flex-shrink: 0;
}
.portal-topbar .topbar-actions {
  min-width: 0;
}
.portal-topbar .topbar-actions a {
  max-width: min(220px, 35vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-layout {
  display: grid;
  flex: 1;
  min-height: calc(100dvh - var(--header-height));
  grid-template-columns: 224px minmax(0, 1fr);
}
.portal-sidebar {
  position: sticky;
  top: var(--header-height);
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  min-height: calc(100dvh - var(--header-height));
  border-right: 1px solid var(--line);
  padding: 32px 16px 24px;
  background: var(--panel);
}
.portal-nav-label {
  padding: 0 14px;
  color: #9399a3;
  font-size: 11px;
}
.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.portal-nav a,
.portal-nav button {
  position: relative;
  display: flex;
  min-height: 44px;
  flex-shrink: 0;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 14px;
  color: #737a85;
  background: transparent;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}
.portal-nav .icon {
  color: #979da6;
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}
.portal-nav a:hover,
.portal-nav button:hover {
  color: var(--ink);
  background: var(--subtle);
}
.portal-nav [aria-current='page'] {
  border-color: #f2e9d1;
  color: var(--ink);
  background: var(--accent-soft);
  font-weight: 600;
}
.portal-nav [aria-current='page']::before {
  position: absolute;
  left: 0;
  top: calc(50% - 8px);
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: #d2ad4c;
  content: '';
}
.portal-nav [aria-current='page'] .icon {
  color: #8b753e;
}
.portal-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 20px 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.portal-sidebar-link .icon {
  width: 15px;
  height: 15px;
}
.portal-content {
  display: flex;
  width: 100%;
  max-width: 1360px;
  min-width: 0;
  flex-direction: column;
  margin: 0 auto;
  padding: 40px;
}
.portal-content .page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.portal-content .page-heading h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.4;
}
.portal-footer {
  margin-top: auto;
  padding-top: 48px;
  color: #9b9fa8;
  font-size: 11px;
}
.portal-content .panel,
.portal-content .action-card,
.portal-content .plan-card {
  border-radius: var(--radius-panel);
}
@media (max-width: 1100px) {
  .portal-layout {
    grid-template-columns: 192px minmax(0, 1fr);
  }
  .portal-content {
    padding: 32px 24px;
  }
  .portal-sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }
}
@media (max-width: 820px) {
  :root {
    --header-height: 68px;
  }
  .portal-topbar {
    padding: 0 20px;
  }
  .portal-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .portal-sidebar {
    z-index: 10;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
  }
  .portal-nav-label,
  .portal-sidebar-link {
    display: none;
  }
  .portal-nav {
    flex-direction: row;
    gap: 5px;
    margin-top: 0;
    overflow: auto;
    scrollbar-width: none;
  }
  .portal-nav a,
  .portal-nav button {
    min-height: 39px;
    gap: 8px;
    padding: 9px 12px;
    font-size: 12px;
  }
  .portal-nav [aria-current='page']::before {
    display: none;
  }
  .portal-content {
    padding: 30px 20px;
  }
  .portal-content .page-heading {
    margin-bottom: 24px;
  }
  .portal-content .page-heading h1 {
    font-size: 27px;
  }
}
@media (max-width: 480px) {
  .portal-topbar {
    padding: 0 18px;
    gap: 12px;
  }
  .portal-content {
    padding: 26px 18px;
  }
  .portal-content .page-heading {
    gap: 12px;
  }
  .portal-content .page-heading h1 {
    font-size: 25px;
  }
}
