.system-menu-mount {
  position: relative;
  display: none;
  flex: 0 0 auto;
}

.system-menu-mount.is-ready {
  display: block;
}

.system-menu {
  position: relative;
  --system-menu-surface: #101a30;
  --system-menu-panel: #0c1426;
  --system-menu-hover: #1a3158;
  --system-menu-active: #12364c;
  --system-menu-icon: #182a4a;
  --system-menu-access: #c4b5fd;
  --system-menu-public: #6ee7b7;
  --system-menu-danger: #fb7185;
  color: var(--text, #eef2ff);
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif);
}

html[data-theme="light"] .system-menu {
  --system-menu-surface: #ffffff;
  --system-menu-panel: #ffffff;
  --system-menu-hover: #e8f0ff;
  --system-menu-active: #e3f3fb;
  --system-menu-icon: #e8f0ff;
  --system-menu-access: #6d28d9;
  --system-menu-public: #047857;
  --system-menu-danger: #be123c;
}

.system-menu > summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line, rgba(148, 163, 184, .28));
  border-radius: 12px;
  background: var(--system-menu-surface);
  color: inherit;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.system-menu > summary::-webkit-details-marker {
  display: none;
}

.system-menu > summary:hover,
.system-menu > summary:focus-visible,
.system-menu[open] > summary {
  border-color: color-mix(in srgb, var(--brand, #7c3aed) 72%, var(--line, #475569));
  background: var(--system-menu-hover);
}

.system-menu > summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-2, #22d3ee) 74%, white);
  outline-offset: 2px;
}

.system-menu-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand, #7c3aed), var(--brand-2, #22d3ee));
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
}

.system-menu-identity {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.system-menu-title {
  font-size: .76rem;
  font-weight: 900;
}

.system-menu-user {
  max-width: 138px;
  overflow: hidden;
  color: var(--muted, #9fb0cc);
  font-size: .65rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-menu-chevron {
  margin-left: 1px;
  color: var(--muted, #9fb0cc);
  font-size: .65rem;
}

.system-menu[open] .system-menu-chevron {
  color: var(--text, #eef2ff);
}

.system-menu-panel {
  position: absolute;
  z-index: 120;
  top: calc(100% + 9px);
  right: 0;
  width: min(330px, calc(100vw - 24px));
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--brand, #7c3aed) 48%, var(--line, #475569));
  border-radius: 15px;
  background: var(--system-menu-panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .38);
}

.system-menu-heading {
  margin: 3px 8px 8px;
  color: var(--muted, #9fb0cc);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.system-menu-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.system-menu-link,
.system-menu-logout {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 45px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text, #eef2ff);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.system-menu-link:hover,
.system-menu-link:focus-visible,
.system-menu-logout:hover,
.system-menu-logout:focus-visible {
  border-color: color-mix(in srgb, var(--brand, #7c3aed) 48%, var(--line, #475569));
  background: var(--system-menu-hover);
  color: var(--text, #eef2ff);
  outline: none;
}

.system-menu-link[aria-current="page"] {
  border-color: color-mix(in srgb, var(--brand-2, #22d3ee) 58%, var(--line, #475569));
  background: var(--system-menu-active);
}

.system-menu-link-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--system-menu-icon);
  font-size: .86rem;
}

.system-menu-link-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.system-menu-link-title {
  font-size: .78rem;
  font-weight: 850;
}

.system-menu-link-note {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted, #9fb0cc);
  font-size: .64rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-menu-access {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 5px;
  color: var(--system-menu-access);
  font-size: .5rem;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
}

.system-menu-link.is-public .system-menu-access {
  color: var(--system-menu-public);
}

.system-menu-divider {
  height: 1px;
  margin: 8px 5px;
  background: var(--line, rgba(148, 163, 184, .28));
}

.system-menu-logout-form {
  margin: 0;
}

.system-menu-logout {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 40px;
  color: var(--system-menu-danger);
}

@media (max-width: 620px) {
  .system-menu-user {
    display: none;
  }

  .system-menu > summary {
    padding-right: 7px;
  }

  .system-menu-panel {
    position: fixed;
    top: 70px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
  }
}
