.site-header:has(.family-nav) {
  min-height: 72px;
  gap: 0 16px;
  padding-block: 4px;
}

.site-header .family-nav {
  gap: clamp(12px, 3vw, 32px);
  margin-left: auto;
  font-size: 13px;
}

.family-nav > a,
.family-account summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

.family-account {
  position: relative;
}

.family-account summary {
  gap: 8px;
  cursor: pointer;
}

.family-account summary::-webkit-details-marker {
  display: none;
}

.family-account summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}

.family-account summary:hover {
  color: var(--rust);
}

.family-account summary:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 3px;
}

.family-account-panel {
  position: absolute;
  z-index: 2;
  top: calc(100% + 4px);
  right: 0;
  width: min(16rem, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--book-page);
}

.family-account-panel p {
  overflow-wrap: anywhere;
}

.family-account-panel .button {
  margin-top: 12px;
  min-height: 44px;
  padding: 8px 16px;
}

.login-card h1 {
  margin-top: 0;
}

.login-card .button {
  justify-content: center;
}

@media (max-width: 700px) {
  .site-header:has(.family-nav) {
    min-height: 52px;
  }
}

@media (max-width: 400px) {
  .site-header .family-nav {
    width: 100%;
    justify-content: space-between;
  }
}

.book-title-link {
  text-decoration: underline;
  text-decoration-color: var(--cloth-edge);
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
}
.book-title-link:hover { text-decoration-color: currentColor; }
