.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.nav-auth {
  display: flex;
  align-items: center;
}

.nav-auth.is-hidden {
  display: none;
}

.account-button,
.account-menu summary,
.account-menu-link,
.account-menu-logout {
  appearance: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
}

.account-button,
.account-menu summary {
  padding: 0.55rem 0.9rem;
  font-weight: 600;
}

.account-button:hover,
.account-menu summary:hover,
.account-menu-link:hover,
.account-menu-logout:hover {
  background: #f8fafc;
}

.account-button:focus-visible,
.account-menu summary:focus-visible,
.account-menu-link:focus-visible,
.account-menu-logout:focus-visible,
.modal-close:focus-visible,
.modal-submit:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  list-style: none;
}

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

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 12rem;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 1400;
}

.account-menu-link,
.account-menu-logout {
  width: 100%;
  padding: 0.7rem 0.85rem;
  text-align: left;
}

.account-menu-logout {
  background: #fff;
}

.account-modal[hidden] {
  display: none;
}

.account-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.52);
  z-index: 1600;
}

.account-modal-dialog {
  width: min(100%, 28rem);
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.account-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.account-modal-header h2 {
  font-size: 1.3rem;
  color: #0f172a;
}

.modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
}

.account-form {
  display: grid;
  gap: 0.95rem;
}

.account-form[hidden] {
  display: none;
}

.account-field {
  display: grid;
  gap: 0.35rem;
}

.account-field label {
  color: #0f172a;
  font-weight: 600;
}

.account-field input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
}

.account-status {
  min-height: 1.2rem;
  color: #b91c1c;
  font-size: 0.95rem;
}

.account-status.is-success {
  color: #166534;
}

.modal-submit {
  appearance: none;
  border: 0;
  border-radius: 6px;
  background: #0066cc;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.8rem 1rem;
}

.modal-submit:hover {
  background: #0052a3;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .nav-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .nav-auth {
    width: 100%;
    justify-content: flex-end;
  }

  .account-menu-panel {
    right: 0;
    left: auto;
  }
}
