/* Keep the account control in cloned tool headers visually consistent with the main site. */
.tool-shell .toolhub-account-menu {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 100%;
}

.tool-shell .public-account-menu,
.tool-shell [data-toolhub-public-account] {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.tool-shell .toolhub-account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 104px;
  height: 40px;
  margin: auto 0;
  border: 1px solid rgba(81, 130, 231, 0.24);
  border-radius: 12px;
  padding: 0 11px 0 8px;
  color: #173568;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(238,246,255,.94));
  box-shadow: 0 9px 22px rgba(43, 84, 161, .12), inset 0 1px rgba(255,255,255,.9);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.tool-shell .toolhub-account-button:hover,
.tool-shell .toolhub-account-menu:focus-within .toolhub-account-button,
.tool-shell .toolhub-account-menu.open .toolhub-account-button {
  border-color: rgba(42, 108, 242, .52);
  background: linear-gradient(135deg, #fff, #eaf3ff);
  box-shadow: 0 12px 26px rgba(36, 100, 225, .18), inset 0 1px rgba(255,255,255,.95);
  transform: translateY(-1px);
}

.toolhub-account-avatar {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #1684ff, #6d68ff);
  box-shadow: 0 5px 12px rgba(40, 93, 213, .22);
  font-size: 12px;
  font-weight: 800;
}

.toolhub-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.toolhub-account-name { max-width: 78px; overflow: hidden; color: inherit; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.toolhub-account-chevron { width: 13px; height: 13px; flex: 0 0 auto; transition: transform .18s ease; }
.toolhub-account-menu:hover .toolhub-account-chevron,
.toolhub-account-menu:focus-within .toolhub-account-chevron,
.toolhub-account-menu.open .toolhub-account-chevron { transform: rotate(180deg); }

.tool-shell .toolhub-account-panel,
.tool-shell .public-account-menu .account-panel,
.tool-shell .public-account-menu .user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: grid;
  min-width: 218px;
  overflow: hidden;
  border: 1px solid rgba(70, 112, 190, .16);
  border-radius: 15px;
  padding: 7px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 22px 55px rgba(29, 60, 119, .2), inset 0 1px rgba(255,255,255,.95);
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px);
  visibility: hidden;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.tool-shell .toolhub-account-panel::before { content: ""; position: absolute; top: -11px; right: 0; left: 0; height: 12px; }
.tool-shell .public-account-menu .account-panel::before,
.tool-shell .public-account-menu .user-menu-panel::before { content: ""; position: absolute; top: -11px; right: 0; left: 0; height: 12px; }
.tool-shell .toolhub-account-menu:hover .toolhub-account-panel,
.tool-shell .toolhub-account-menu:focus-within .toolhub-account-panel,
.tool-shell .toolhub-account-menu.open .toolhub-account-panel,
.tool-shell .public-account-menu:hover .account-panel,
.tool-shell .public-account-menu:focus-within .account-panel,
.tool-shell .public-account-menu.open .account-panel,
.tool-shell .public-account-menu:hover .user-menu-panel,
.tool-shell .public-account-menu:focus-within .user-menu-panel,
.tool-shell .public-account-menu.open .user-menu-panel { opacity: 1; pointer-events: auto; transform: translateY(0); visibility: visible; }

.toolhub-account-panel a,
.toolhub-account-panel button,
.tool-shell .public-account-menu .account-panel a,
.tool-shell .public-account-menu .account-panel button,
.tool-shell .public-account-menu .user-menu-panel a,
.tool-shell .public-account-menu .user-menu-panel button {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 43px;
  border: 0;
  border-radius: 10px;
  padding: 6px 9px;
  color: #1b2a48;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}
.toolhub-account-panel a:hover,
.toolhub-account-panel button:hover,
.tool-shell .public-account-menu .account-panel a:hover,
.tool-shell .public-account-menu .account-panel button:hover,
.tool-shell .public-account-menu .user-menu-panel a:hover,
.tool-shell .public-account-menu .user-menu-panel button:hover { background: #f1f6ff; color: #1767f2; }
.toolhub-account-panel svg,
.tool-shell .public-account-menu .account-panel svg,
.tool-shell .public-account-menu .user-menu-panel svg { width: 31px; height: 31px; padding: 7px; border-radius: 9px; color: #1767f2; background: #edf4ff; }

@media (max-width: 620px) {
  .tool-shell .toolhub-account-button { min-width: 40px; width: 40px; justify-content: center; padding: 0; }
  .toolhub-account-name, .toolhub-account-chevron { display: none; }
}
