.header { position: relative; z-index: 5; }
.header-choice { position: relative; }
.header-choice summary {
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.header-choice summary::-webkit-details-marker { display: none; }
.header-choice summary:focus-visible, .choice-list a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.header-choice summary::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 8px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.header-choice[open] summary::after { transform: rotate(225deg); }
.choice-list {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: min(235px, 90vw);
  max-height: min(360px, 58vh);
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
  transform-origin: top left;
  animation: choice-appear 180ms ease-out;
}
@supports (backdrop-filter: blur(10px)) {
  .choice-list {
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
  }
}
.login-choice .choice-list {
  left: auto;
  right: 0;
  width: max-content;
  max-width: 90vw;
  padding: 5px;
  transform-origin: top right;
}
.choice-list a {
  display: block;
  padding: 9px 10px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.choice-list a:hover, .choice-list a:focus-visible { background: rgb(0 0 0 / 6%); }
.header nav .choice-list a::after { content: none; }
@keyframes choice-appear {
  from { opacity: 0; transform: translateY(-5px) scale(.98); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 650px) {
  .header nav .header-choice { position: static; }
  .header nav .choice-list { top: calc(100% + 4px); left: 5%; }
}
@media (prefers-reduced-motion: reduce) {
  .choice-list { animation: none; }
}
