/* Account dropdown menu in the header — shared by the wiki shell (app.html,
   .topbar) and the standalone account pages (_account_nav.html,
   .account-topbar). Built on Pico's no-JS <details class="dropdown">. The
   summary is a plain text trigger that blends into the dark chrome; the menu
   itself uses Pico's variables (dark wherever data-theme="dark" applies). */

.account-menu {
  position: relative;
  margin: 0;
}

/* The clickable name trigger. */
/* Selector matches Pico's own `details.dropdown>summary:not([role])` specificity
   so our compact sizing wins (this file loads after pico.min.css). */
details.account-menu > summary:not([role]) {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  width: auto;
  height: auto;
  padding: 1px 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #ccc;
  background: transparent;
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}
.account-menu > summary::-webkit-details-marker {
  display: none;
}
.account-menu > summary:hover {
  background: #2d2d2d;
  color: #fff;
}
/* Caret. */
.account-menu > summary::after {
  content: "▾";
  font-size: 0.7rem;
  opacity: 0.8;
}

/* The menu panel. Selectors mirror Pico's own `details.dropdown>summary+ul ...`
   specificity so our dark colors and full-width items win (loaded after Pico).
   Colors are hardcoded dark on purpose — Pico's dropdown palette was bleeding
   blue/primary through, which is wrong against the dark chrome. */
details.account-menu > summary + ul {
  position: absolute;
  right: 0;
  left: auto;
  z-index: 99;
  width: auto;
  min-width: 13rem;
  margin: 0.3rem 0 0;
  padding: 0.3rem;
  list-style: none;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
details.account-menu > summary + ul li {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
details.account-menu > summary + ul li form {
  width: 100%;
  margin: 0;
}
details.account-menu > summary + ul li a,
details.account-menu > summary + ul li button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: normal;
  line-height: 1.3;
  color: #ccc;
  background: transparent;
  border: 0;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}
details.account-menu > summary + ul li a:hover,
details.account-menu > summary + ul li button:hover {
  background: #2d2d2d;
  color: #fff;
}
details.account-menu > summary + ul hr {
  margin: 0.3rem 0;
  border: 0;
  border-top: 1px solid #333;
}
