/* Account dropdown: compact navigation with neutral surfaces. */
.account-menu,
.account-guest {
  position: relative;
  display: flex;
  align-items: center;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.account-avatar:hover,
.account-avatar[aria-expanded="true"] { border-color: light-dark(#22222240, #ffffff50); }
.account-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.account-dropdown {
  --account-bg: #202124;
  --account-raised: #28292c;
  --account-text: #e8eaed;
  --account-muted: #9fa3aa;
  --account-border: #ffffff16;
  --account-hover: #ffffff0d;
  --account-icon: #b4b8bf;
  --account-danger: #f28b82;
  --account-danger-bg: #f28b8210;
  position: absolute;
  z-index: 1000;
  top: calc(100% + 10px);
  right: 0;
  box-sizing: border-box;
  width: 280px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--account-border) transparent;
  padding: 6px;
  border: 1px solid var(--account-border);
  border-radius: 10px;
  color: var(--account-text);
  background: var(--account-bg);
  box-shadow: 0 8px 24px #0004, 0 2px 6px #0002;
  font-family: 'Outfit-Regular', sans-serif;
  font-size: 13px;
  line-height: 20px;
  text-align: left;
  animation: accountMenuIn 100ms ease-out;
}
.account-dropdown *,
.account-dropdown *::before,
.account-dropdown *::after { box-sizing: border-box; }
.account-dropdown[hidden],
.account-theme-options[hidden] { display: none; }
@keyframes accountMenuIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.account-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--account-border);
}
.account-header-avatar {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--account-raised);
}
.account-header-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.account-header-info > span {
  color: var(--account-muted);
  font-size: 11px;
  line-height: 17px;
}
.account-items-title {
  margin: 0;
  color: var(--account-text);
  font: inherit;
  font-size: 13px;
  line-height: 20px;
}
.account-header-info .account-items-title {
  overflow: hidden;
  font-size: 14px;
  font-family: 'Outfit-Medium';
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-section {
  padding: 4px 0;
  border-bottom: 1px solid var(--account-border);
}
.account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 5px;
  color: inherit;
  text-decoration: none;
  transition: background-color 120ms ease;
}
.account-item:hover,
.account-item:focus-visible { background: var(--account-hover); }
.account-item-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 20px;
  flex: 0 0 18px;
  color: var(--account-icon);
}
.account-item-icon svg { width: 18px; height: 18px; }
.account-item-content { flex: 1; min-width: 0; }

.account-appearance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 7px 10px;
}
.account-section-label { min-width: 0; }
.account-section-label > span { color: var(--account-text); font-size: 13px; }
.account-theme-picker { position: relative; flex: 0 0 112px; }
.account-theme-button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--account-border);
  border-radius: 5px;
  color: var(--account-text);
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.account-theme-button:hover,
.account-theme-button[aria-expanded="true"] { background: var(--account-hover); }
.theme-current-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--account-icon);
}
.account-theme-picker [data-theme-label] { flex: 1; font-size: 12px; text-align: left; }
.theme-chevron { width: 12px; height: 12px; color: var(--account-muted); }
.account-theme-button[aria-expanded="true"] .theme-chevron { transform: rotate(180deg); }
.account-theme-button .theme-current-sun { display: none; }
html[data-theme="light"] .account-theme-button .theme-current-moon { display: none; }
html[data-theme="light"] .account-theme-button .theme-current-sun { display: block; }
.account-theme-options {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: calc(100% + 4px);
  width: 144px;
  padding: 4px;
  border: 1px solid var(--account-border);
  border-radius: 6px;
  background: var(--account-raised);
  box-shadow: 0 4px 12px #0003;
}
.account-theme-options button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 3px;
  color: var(--account-text);
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.account-theme-options button:hover,
.account-theme-options button[aria-selected="true"] { background: var(--account-hover); }
.theme-option-icon { display: flex; color: var(--account-icon); }
.account-theme-check { display: flex; margin-left: auto; color: var(--account-text); opacity: 0; }
.account-theme-options button[aria-selected="true"] .account-theme-check { opacity: 1; }

.account-footer { padding-top: 4px; }
.account-logout,
.account-notifications {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  color: var(--account-text);
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-notifications:hover { background: var(--account-hover); }
.account-logout:hover { color: var(--account-danger); background: var(--account-danger-bg); }
.account-logout:disabled { opacity: 0.5; cursor: wait; }
.account-logout-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 20px;
  flex: 0 0 18px;
  color: var(--account-icon);
}
.account-logout-icon svg { width: 18px; height: 18px; }
.account-logout:hover .account-logout-icon { color: inherit; }
.account-error {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--account-danger);
  background: var(--account-danger-bg);
  font-size: 12px;
  line-height: 18px;
}
.account-avatar:focus-visible,
.account-dropdown :is(a, button):focus-visible {
  outline: 2px solid #f16f01;
  outline-offset: -2px;
}
.account-theme-picker button:focus-visible {
  outline: none;
  box-shadow: none;
  background: var(--account-hover);
}

/* Guest header actions. */
.account-guest {
  gap: 7px;
}

.account-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  color: light-dark(#f5f5f5, #303030);
  background: light-dark(#303030, #f5f5f5);
  border-radius: 25px;
  font-size: 12px;
  font-family: 'Outfit-SemiBold';
  text-decoration: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}
.account-register{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  color: light-dark(#f5f5f5, #f5f5f5);
  background: light-dark(#F16F01, #F16F01);
  border-radius: 25px;
  font-size: 12px;
  font-family: 'Outfit-SemiBold';
  text-decoration: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}
.account-register:hover {
  opacity: 0.88;
}

.account-register:active {
  transform: scale(0.96);
}
.account-login:hover {
  opacity: 0.88;
}

.account-login:active {
  transform: scale(0.96);
}


/* =========================================================
   THEME TOGGLE
   ========================================================= */

.theme-header-toggle {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  padding: 0;

  color: light-dark(#303030, #f5f5f5);
  background: light-dark(transparent, transparent);

  border: 0;
  border-radius: 8px;

  cursor: pointer;

  transition:
    color 140ms ease,
    background-color 140ms ease;
}

.theme-header-toggle:hover {
  background: light-dark(#3030303f, #3030303f);
}

.theme-header-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-icon-moon {
  display: none;
}


html[data-theme="light"] .account-dropdown {
  --account-bg: #ffffff;
  --account-raised: #ffffff;
  --account-text: #202124;
  --account-muted: #656a72;
  --account-border: #2021241c;
  --account-hover: #20212408;
  --account-icon: #656a72;
  --account-danger: #b3261e;
  --account-danger-bg: #b3261e0b;
  box-shadow: 0 8px 24px #20212416, 0 2px 6px #2021240a;
}
html[data-theme="light"] .theme-header-toggle:hover { background: #22242a0e; }
@media (max-width: 480px) {
  .account-dropdown {
    position: fixed;
    top: 72px;
    right: 12px;
  }
  .account-item,
  .account-notifications,
  .account-logout,
  .account-theme-options button { min-height: 44px; }
  .account-theme-button { min-height: 36px; }
  .account-appearance { min-height: 52px; }
}
@media (max-width: 460px) {
  .account-dropdown {
    top: 64px;
    max-height: calc(100vh - 76px);
    max-height: calc(100dvh - 76px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .account-dropdown { animation: none; }
  .account-avatar,
  .account-dropdown :is(a, button) { transition: none; }
}
