:root {
  --sidebar-width-expanded: 19rem;
  --sidebar-width-collapsed: 6rem;
  --sidebar-current-width: 19rem;
  --mobile-nav-height: 4.25rem;
  --test-banner-offset: 0rem;
}

body.has-test-banner {
  --test-banner-offset: 3.75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background-color: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 4px 16px rgba(var(--color-neutral-black-rgb), 0.18);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.theme-dark .site-header {
  background-color: var(--color-background);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.75rem 0.75rem 0.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.header-inner::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sidebar-toggle,
.sidebar-toggle:where(:hover, :focus-visible, :active) {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--header-border-rgb), 0.25);
  background: var(--header-surface);
  color: var(--header-text);
  cursor: pointer;
  transition: none;
}

.sidebar-toggle__icon {
  font-size: 1rem;
  display: inline-flex;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo__image {
  display: block;
  height: 3.25rem;
  width: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.header-logo__image.is-transitioning {
  opacity: 0;
  transform: scale(0.94);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  flex-shrink: 0;
}

.header-notifications {
  position: relative;
  display: inline-flex;
}

.header-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.header-quick-button,
.header-quick-button:where(:hover, :focus-visible, :active) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--header-surface);
  color: var(--header-text);
  cursor: pointer;
  position: relative;
  transition: none;
}

.header-quick-button--accent,
.header-quick-button--accent:where(:hover, :focus-visible, :active) {
  background: var(--header-accent);
  color: var(--color-brand-primary-strong);
  border-color: rgba(var(--header-surface-rgb), 0.15);
  box-shadow: 0 6px 18px rgba(var(--color-neutral-black-rgb), 0.22);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(45%, -40%);
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--header-accent);
  color: var(--color-brand-primary-badge);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--header-bg);
  box-shadow: 0 6px 14px rgba(var(--color-neutral-black-rgb), 0.2);
  letter-spacing: -0.01em;
}

.notification-badge.is-empty {
  background: rgba(var(--header-border-rgb), 0.65);
  color: var(--color-brand-primary-badge);
  opacity: 0.7;
}

.floating-notifications {
  position: fixed;
  top: var(--floating-notifications-offset, 1.5rem);
  right: 1.5rem;
  left: auto;
  bottom: auto;
  z-index: 85;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.floating-notifications__button,
.floating-notifications__button:where(:hover, :focus-visible, :active) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  border: none;
  background: rgba(var(--color-brand-primary-rgb), 0.95);
  color: var(--color-brand-primary-contrast);
  cursor: pointer;
  position: relative;
  box-shadow: 0 14px 32px rgba(var(--color-neutral-black-rgb), 0.25);
  transition: none;
  outline: none;
}

.floating-notifications__icon {
  font-size: 1.25rem;
  display: inline-flex;
}

.floating-notifications__badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(40%, -40%);
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--header-accent);
  color: var(--color-brand-primary-badge);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(var(--color-brand-primary-rgb), 0.95);
  box-shadow: 0 10px 26px rgba(var(--color-neutral-black-rgb), 0.28);
}

.floating-notifications__badge.is-empty {
  background: rgba(var(--header-border-rgb), 0.65);
  color: var(--color-brand-primary);
}

[data-theme="dark"] .floating-notifications__badge.is-empty {
  background: #546856;
}

.floating-notifications__panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  left: auto;
  min-width: 18rem;
  max-width: clamp(16rem, 30vw, 22rem);
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  background: rgba(var(--color-brand-primary-night-rgb), 1);
  border: 1px solid rgba(var(--header-border-rgb), 0.22);
  box-shadow: 0 22px 45px rgba(var(--color-neutral-black-rgb), 0.3);
  color: var(--header-text);
  opacity: 0;
  transform: translate3d(0, -0.45rem, 0);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow-x: hidden;
}

.floating-notifications__panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

@media (min-width: 768px) {
  .notifications-panel {
    width: 420px;
    max-width: 90vw;
    padding: 1rem 1.25rem;
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }
}

.header-search {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
}

.header-search.is-open {
  display: flex;
}

.header-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--color-neutral-black-rgb), 0.55);
  backdrop-filter: blur(4px);
}

.header-search__panel {
  position: relative;
  width: min(520px, 92vw);
  padding: 1.75rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--color-surface-muted);
  box-shadow: 0 24px 70px rgba(var(--color-neutral-black-rgb), 0.3);
  border: 1px solid rgba(var(--color-brand-primary-rgb), 0.2);
  z-index: 1;
}

.header-search__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.header-search__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-brand-primary-strong);
}

.header-search__field,
.header-search__field:focus-within {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--color-brand-primary-rgb), 0.2);
  background: var(--color-surface-strong);
  padding-left: 2.5rem;
  box-shadow: none;
}

.header-search__field-icon {
  position: absolute;
  left: 1rem;
  font-size: 1rem;
  color: rgba(var(--color-brand-primary-rgb), 0.6);
}

.header-search__input,
.header-search__input:where(:focus, :active) {
  flex: 1;
  border: none;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--color-brand-primary-strong);
  background: transparent;
  outline: none;
}

.header-search__clear,
.header-search__clear:where(:hover, :focus-visible, :active) {
  background: none;
  border: none;
  color: rgba(var(--color-brand-primary-rgb), 0.55);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.75rem 0 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-search__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.header-search__submit,
.header-search__submit:where(:hover, :focus-visible, :active),
.header-search__cancel,
.header-search__cancel:where(:hover, :focus-visible, :active) {
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: none;
}

.header-search__submit,
.header-search__submit:where(:hover, :focus-visible, :active) {
  background: var(--color-brand-primary);
  color: var(--color-brand-primary-contrast-soft);
  border-color: rgba(var(--color-brand-primary-rgb), 0.8);
}

.header-search__cancel,
.header-search__cancel:where(:hover, :focus-visible, :active) {
  background: transparent;
  color: var(--color-brand-primary);
  border-color: rgba(var(--color-brand-primary-rgb), 0.35);
}

.header-quick-dropdown,
.header-dropdown-group,
.mobile-bottom-nav__item {
  position: relative;
}

.notification-badge--mobile {
  transform: translate(55%, -45%);
}

.header-main {
  display: none;
}

.header-nav {
  display: none;
}

.header-auth {
  display: none;
}

.header-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.header-nav__item {
  position: relative;
}

.header-nav__link,
.header-nav__link:where(:hover, :focus-visible, :active, :visited),
.header-nav__link.is-active {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.9rem;
  color: var(--header-text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  background-color: transparent;
  transition: none;
  opacity: 1;
}

.menu-static-highlight,
.menu-static-highlight:where(:hover, :focus-visible, :active, :visited) {
  color: #dddbd1 !important;
}

.menu-static-highlight .header-nav__icon,
.menu-static-highlight .header-nav__text,
.menu-static-highlight .header-auth__icon,
.menu-static-highlight .header-auth__text {
  color: #dddbd1 !important;
}

.menu-static-highlight svg,
.menu-static-highlight svg *,
.menu-static-highlight :is(svg, i) {
  color: #dddbd1 !important;
  fill: #dddbd1 !important;
  stroke: #dddbd1 !important;
}

.header-nav__link--button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

.header-nav__chevron {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.65;
}

.header-nav__icon {
  width: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.header-nav__text {
  white-space: nowrap;
}

.header-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 13.5rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.65rem 0.5rem;
  background: rgba(var(--color-brand-primary-night-rgb), 0.95);
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--header-border-rgb), 0.2);
  box-shadow: 0 20px 40px rgba(var(--color-neutral-black-rgb), 0.25);
  opacity: 0;
  transform: translate3d(0, 0.35rem, 0);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  overflow-x: hidden;
}

.header-quick-dropdown .header-dropdown {
  right: 0;
  left: auto;
}

.header-dropdown--notifications {
  min-width: 18rem;
  padding: 0.85rem 0.9rem;
}

.header-dropdown--mobile {
  left: 50%;
  transform: translate3d(-50%, 0.35rem, 0);
  min-width: 15rem;
}

[data-dropdown].is-open > .header-dropdown,
[data-dropdown].is-open .header-dropdown {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

[data-dropdown].is-open .header-dropdown--mobile {
  transform: translate3d(-50%, 0, 0);
}


.header-dropdown__link,
.header-dropdown__link:where(:hover, :focus-visible, :active, :visited) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  color: var(--header-text);
  text-decoration: none;
  font-weight: 600;
  background-color: transparent;
  transition: none;
}

.header-dropdown__link i {
  font-size: 0.95rem;
}


.header-dropdown__empty {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(var(--header-border-rgb), 0.8);
}

.notifications-panel__status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: rgba(var(--header-border-rgb), 0.85);
}

.notifications-panel__status[hidden],
.notifications-panel__list[hidden],
.header-dropdown__empty[hidden] {
  display: none !important;
}

.notifications-panel__status--error {
  color: var(--color-alert-soft);
}

.notifications-panel__status-text {
  flex: 1;
}

[data-theme="dark"] .notifications-panel__status:not(.notifications-panel__status--error) .notifications-panel__status-text {
  color: #DDDBD1;
}

.notifications-panel__spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(var(--header-border-rgb), 0.25);
  border-top-color: rgba(var(--header-border-rgb), 0.85);
  animation: notifications-spinner 0.8s linear infinite;
}

.notifications-panel__retry,
.notifications-panel__retry:where(:hover, :focus-visible, :active) {
  background: transparent;
  border: 1px solid rgba(var(--header-border-rgb), 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  color: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: none;
}

.notifications-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: min(24rem, 70vh);
  overflow-y: auto;
  padding-right: 0.2rem;
  scroll-padding-right: 0.2rem;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.notifications-panel__list::-webkit-scrollbar {
  width: 0.35rem;
}

.notifications-panel__list::-webkit-scrollbar-thumb {
  background-color: rgba(var(--header-border-rgb), 0.35);
  border-radius: 999px;
}

.notifications-panel__list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(var(--header-border-rgb), 0.35);
}

.notifications-panel__list-item {
  margin: 0;
}

.notifications-panel__item,
.notifications-panel__item:where(:hover, :focus-visible, :active) {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.85rem;
  text-decoration: none;
  background-color: transparent;
  color: var(--header-text);
  transition: none;
}

.notifications-panel__item.is-read {
  opacity: 0.7;
}

.notifications-panel__icon {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background-color: rgba(var(--header-border-rgb), 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  opacity: 0.85;
  font-size: 1rem;
}

.notifications-panel__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.notifications-panel__message {
  font-weight: 600;
  font-size: 0.97rem;
  color: inherit;
}

.notifications-panel__context {
  font-size: 0.85rem;
  font-weight: 600;
  /* Light theme (default): black */
  color: #000000;
}

/* Dark theme: notifications context should be muted light */
/* dark-theme overrides moved to static/css/theme.css */

.notifications-panel__preview {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(var(--header-border-rgb), 0.78);
}

.notifications-panel__time {
  font-size: 0.78rem;
  color: rgba(var(--header-border-rgb), 0.65);
}

.notifications-panel__status-dot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background-color: var(--header-accent-soft);
  margin-left: 0.25rem;
  margin-top: 0.45rem;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.notifications-panel__item.is-read .notifications-panel__status-dot {
  opacity: 0;
}

.notifications-close {
  display: none;
}

@media (max-width: 767px) {
  .notifications-panel {
    position: fixed;
    top: auto;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 80vh;
    max-height: 80vh;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 4vh, 1.35rem);
    overflow-y: auto;
    border-radius: 0;
    padding-left: clamp(1rem, 6vw, 1.75rem);
    padding-right: clamp(1rem, 6vw, 1.75rem);
    padding-top: calc(clamp(1.1rem, 5vh, 2.25rem) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    transform: none !important;
  }

  @supports (height: 100dvh) {
    .notifications-panel {
      height: 80dvh;
      max-height: 80dvh;
    }
  }

  @supports (height: 100svh) {
    .notifications-panel {
      height: 80svh;
      max-height: 80svh;
    }
  }

  .notifications-panel__status,
  .header-dropdown__empty {
    margin: 0;
  }

  .notifications-panel__list {
    flex: 1;
    max-height: none;
    min-height: 0;
  }

  .notifications-close {
    display: block;
    position: absolute;
    top: clamp(0.9rem, 4vh, 1.4rem);
    right: calc(1rem + env(safe-area-inset-right, 0px));
    font-size: 1.8rem;
    color: var(--header-text-strong);
    cursor: pointer;
  }
}

.notifications-panel.visible {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* === Notifications Panel Override === */
.notifications-panel__list-item {
  background: none;
  border: none;
  padding: 0;
}

/* Light mode: subtle, semi-transparent surface, no hover darkening */
:root.theme-light .notifications-panel__item,
:root.theme-light .notifications-panel__item:where(:hover, :focus-visible, :active) {
  background-color: rgba(var(--color-surface-cloud-rgb), 0.9);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  color: var(--color-text-primary);
  border: 1px solid rgba(var(--color-brand-primary-rgb), 0.08);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: none !important;
  cursor: pointer;
}

/* If JS applies an active/selected class, keep the same background in light mode */
:root.theme-light .notifications-panel__item.notifications-panel__item--active,
:root.theme-light .notifications-panel__item.is-active,
:root.theme-light .notifications-panel__item.is-selected {
  background-color: rgba(var(--color-surface-cloud-rgb), 0.9) !important;
}

/* Prevent global link hover rules from underlining or recoloring links inside notifications */
:root.theme-light .notifications-panel__item a,
:root.theme-light .notifications-panel__item a:where(:focus, :hover, :visited) {
  text-decoration: none !important;
  color: inherit !important;
}

/* Text hierarchy in light mode */
:root.theme-light .notifications-panel__body,
:root.theme-light .notifications-panel__message,
:root.theme-light .notifications-panel__context,
:root.theme-light .notifications-panel__preview,
:root.theme-light .notifications-panel__time {
  color: var(--color-text-primary) !important;
}

/* Dark mode: keep existing darker surface but ensure contrast */
html.theme-dark .notifications-panel__item,
html.theme-dark .notifications-panel__item:where(:hover, :focus-visible, :active) {
  background-color: rgba(var(--color-brand-primary-rgb), 0.12);
  color: var(--color-text-primary);
  box-shadow: 0 16px 34px rgba(var(--color-brand-primary-shadow-rgb), 0.3);
  border: 1px solid rgba(var(--color-brand-primary-rgb), 0.15);
}

html.theme-dark .notifications-panel__message,
html.theme-dark .notifications-panel__context,
html.theme-dark .notifications-panel__preview,
html.theme-dark .notifications-panel__time {
  color: var(--color-text-primary);
}

.notifications-panel__status-dot {
  background-color: rgba(var(--color-brand-accent-rgb), 1);
  box-shadow: 0 0 0 2px rgba(var(--color-brand-primary-rgb), 0.08);
}

html.theme-dark .notifications-panel__status-dot {
  box-shadow: 0 0 0 2px rgba(var(--color-brand-primary-rgb), 0.2);
}
/* === END === */

@keyframes notifications-spinner {
  to {
    transform: rotate(360deg);
  }
}

.header-auth__links {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.header-auth__link,
.header-auth__link:where(:hover, :focus-visible, :active, :visited) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: none;
}

.header-auth__link--login,
.header-auth__link--login:where(:hover, :focus-visible, :active, :visited) {
  background-color: transparent;
  border-color: rgb(221, 219, 209);
  color: var(--header-text);
}

.header-auth__link--signup,
.header-auth__link--signup:where(:hover, :focus-visible, :active, :visited) {
  background-color: var(--header-text-strong);
  color: var(--color-brand-primary);
}

:root.theme-light .header-auth__link--login,
:root.theme-light .header-auth__link--login:where(:hover, :focus-visible, :active, :visited) {
  color: #dddbd1;
}

:root.theme-light .header-auth__link--signup,
:root.theme-light .header-auth__link--signup:where(:hover, :focus-visible, :active, :visited) {
  color: #000000;
}

:root.theme-dark .header-auth__link--login,
:root.theme-dark .header-auth__link--login:where(:hover, :focus-visible, :active, :visited) {
  background-color: rgba(var(--header-surface-rgb), 0.82);
  border-color: rgb(221, 219, 209);
}

:root.theme-dark .header-auth__link--signup,
:root.theme-dark .header-auth__link--signup:where(:hover, :focus-visible, :active, :visited) {
  color: #000000;
}

.header-auth__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.header-auth__text {
  margin-left: 0.45rem;
}

.header-user {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background-color: var(--header-surface);
  border: 1px solid rgba(var(--header-border-rgb), 0.2);
  gap: 0.4rem;
}

.header-user__profile,
.header-user__profile:where(:hover, :focus-visible, :active, :visited) {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding-right: 0.85rem;
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: none;
}

.header-user__profile::after,
.header-user__profile:where(:hover, :focus-visible, :active, :visited)::after {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  right: 0;
  width: 1px;
  background-color: rgba(var(--header-border-rgb), 0.25);
}

.header-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background-color: var(--header-text-strong);
  color: var(--color-brand-primary);
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  flex-shrink: 0;
}

.header-user__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-user__avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.header-user__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-user__greeting {
  font-size: 0.7rem;
  opacity: 0.8;
  white-space: nowrap;
}

.header-user__name {
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.header-user__action,
.header-user__action:where(:hover, :focus-visible, :active, :visited) {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--header-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: none;
}

.header-user__action--button,
.header-user__action--button:where(:hover, :focus-visible, :active) {
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: none;
}

.header-mobile-profile,
.header-mobile-profile:where(:hover, :focus-visible, :active, :visited) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(var(--header-border-rgb), 0.18);
  color: var(--header-bg);
  text-decoration: none;
  overflow: hidden;
  border: 1px solid rgba(var(--header-border-rgb), 0.4);
  transition: none;
  transform: none;
  box-shadow: none;
}

.header-mobile-profile__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-mobile-profile__avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-brand-primary);
}

.header-section-badge {
  margin: 0 auto 0.6rem auto;
  width: min(1100px, 100%);
  padding: 0 1rem 0.2rem;
  color: var(--header-text);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.mobile-bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--mobile-nav-height);
  padding: 0.5rem 1.5rem 0.75rem;
  /* Use mobile header color token to allow different mobile/desktop colors */
  background: rgba(var(--header-bg-mobile-rgb), 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(var(--header-border-rgb), 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 95;
  transform: translateY(0);
  transition: transform 0.28s ease, opacity 0.28s ease;
  will-change: transform;
  opacity: 1;
  visibility: visible;
}

.mobile-bottom-nav.is-hidden {
  transform: translateY(calc(100% + 2.5rem));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  transform: translateY(0);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  will-change: transform;
  z-index: 999;
  opacity: 1;
  visibility: visible;
}

.bottom-nav.hidden,
.mobile-bottom-nav.is-hidden {
  transform: translateY(calc(100% + 2.5rem));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  transform: translateY(0);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  will-change: transform;
  z-index: 999;
  opacity: 1;
  visibility: visible;
}

.bottom-nav.hidden,
.mobile-bottom-nav.is-hidden {
  transform: translateY(calc(100% + 2.5rem));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.mobile-bottom-nav__link,
.mobile-bottom-nav__link:where(:hover, :focus-visible, :active, :visited),
.mobile-bottom-nav__link.is-active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  color: var(--header-text, #234435);
  background: transparent;
  border: none;
  text-decoration: none;
  font-size: 1.35rem;
  transition: none;
  position: relative;
}

.mobile-bottom-nav__link--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.mobile-bottom-nav__item--dropdown .header-dropdown {
  bottom: calc(100% + 0.5rem);
  top: auto;
  border-radius: 1rem;
  text-align: left;
}

.mobile-bottom-nav__link--profile,
.mobile-bottom-nav__link--profile:where(:hover, :focus-visible, :active, :visited),
.mobile-bottom-nav__link--profile.is-active {
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(var(--header-border-rgb), 0.32);
  background: rgba(var(--header-border-rgb), 0.18);
  transition: none;
}

.mobile-bottom-nav__profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mobile-bottom-nav__profile-initial {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-brand-primary);
  background: rgba(var(--header-border-rgb), 0.9);
}

body {
  padding-bottom: var(--mobile-nav-height);
  transition: padding-bottom 0.25s ease;
}

body.no-scroll {
  overflow: hidden;
}

.site-header.is-animating .header-nav__item,
.site-header.is-animating .header-auth__link,
.site-header.is-animating .header-user {
  animation: headerItemReveal 0.35s ease both;
}

.site-header.is-animating .header-logo__image {
  animation: headerLogoSwap 0.3s ease forwards;
}

.site-header.is-animating .header-nav__item:nth-child(1) {
  animation-delay: 0.06s;
}

.site-header.is-animating .header-nav__item:nth-child(2) {
  animation-delay: 0.1s;
}

.site-header.is-animating .header-nav__item:nth-child(3) {
  animation-delay: 0.14s;
}

.site-header.is-animating .header-nav__item:nth-child(4) {
  animation-delay: 0.18s;
}

.site-header.is-animating .header-nav__item:nth-child(5) {
  animation-delay: 0.22s;
}

.site-header.is-animating .header-auth__link {
  animation-delay: 0.24s;
}

.site-header.is-animating .header-user {
  animation-delay: 0.28s;
}

@keyframes headerItemReveal {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes headerLogoSwap {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 767px) {
  .site-header {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    border-bottom: none;
    /* On small screens use the mobile header color */
    background-color: var(--header-bg-mobile);
    border-top: 1px solid rgba(var(--header-border-rgb), 0.18);
    box-shadow: 0 -10px 24px rgba(var(--color-neutral-black-rgb), 0.2);
  }

  .header-inner,
  .header-section-badge {
    display: none;
  }

  .mobile-bottom-nav {
    position: static;
  }

  .floating-notifications {
    display: none;
  }

  .header-search {
    align-items: flex-start;
    padding: 1.5rem 1rem 0;
  }

  .header-search__panel {
    width: 100%;
    border-radius: 1rem;
  }
}

@media (min-width: 768px) {
  .header-mobile-profile {
    display: none;
  }

  body {
    padding-bottom: 0;
  }

  .mobile-bottom-nav {
    display: none;
  }
}

@media (min-width: 1024px) {
  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width-expanded);
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(var(--header-border-rgb), 0.12);
  }

  .header-inner {
    flex: 1;
    padding: 1.5rem 1.25rem 2rem;
    overflow-y: auto;
  }

  .header-main {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }

  .header-nav {
    display: block;
  }

  .header-auth {
    display: block;
  }

  .header-nav__list {
    gap: 0.45rem;
  }

  .header-nav__link {
    width: 100%;
    padding: 0.7rem 0.95rem;
  }

  .header-nav__link--button {
    justify-content: flex-start;
  }

  .header-nav__item--dropdown .header-dropdown {
    left: 0;
  }

  .header-notifications {
    display: none;
  }

  .header-dropdown--notifications {
    min-width: 20rem;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .header-top {
    gap: 1rem;
  }

  .header-brand {
    align-items: center;
  }

  body.with-sidebar {
    padding-left: var(--sidebar-width-expanded);
    --sidebar-current-width: var(--sidebar-width-expanded);
    transition: padding-left 0.25s ease;
  }

  body.with-sidebar.sidebar-collapsed {
    padding-left: var(--sidebar-width-collapsed);
    --sidebar-current-width: var(--sidebar-width-collapsed);
  }

  .site-header.is-collapsed {
    width: var(--sidebar-width-collapsed);
  }

  .site-header.is-collapsed .sidebar-toggle__icon {
    transform: rotate(180deg);
  }

  .site-header.is-collapsed .header-brand {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .site-header.is-collapsed .sidebar-toggle,
  .site-header.is-collapsed .header-logo {
    margin: 0 auto;
  }

  .site-header.is-collapsed .header-nav__text,
  .site-header.is-collapsed .header-nav__chevron,
  .site-header.is-collapsed .header-auth__text,
  .site-header.is-collapsed .header-user__meta,
  .site-header.is-collapsed .header-user__action .header-auth__text {
    display: none;
  }

  .site-header.is-collapsed .header-nav__link,
  .site-header.is-collapsed .header-auth__link,
  .site-header.is-collapsed .header-user,
  .site-header.is-collapsed .header-user__profile,
  .site-header.is-collapsed .header-user__action {
    justify-content: center;
  }

  .site-header.is-collapsed .header-nav__link {
    padding-inline: 0.85rem;
  }

  .site-header.is-collapsed .header-user__profile {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
  }

  .site-header.is-collapsed .header-user__profile::after {
    display: none;
  }

  .site-header.is-collapsed .header-user {
    padding-inline: 0.35rem;
  }

  .site-header.is-collapsed .header-user__action {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    padding-inline: 0.75rem 0.5rem;
  }

  .site-header.is-collapsed .header-nav__item--dropdown .header-dropdown {
    left: calc(100% + 0.75rem);
    top: 0;
  }

  .header-dropdown--notifications {
    right: 0;
    left: auto;
  }

  .header-quick-actions {
    gap: 0.6rem;
  }

  /* Hide all quick action buttons (search, theme toggle) when sidebar is collapsed */
  .site-header.is-collapsed .header-quick-button[data-search-toggle],
  .site-header.is-collapsed .header-quick-button[data-theme-toggle] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Hide the "Crear cuenta" button when sidebar is collapsed */
  .site-header.is-collapsed .header-auth__link--signup {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Hide the header-actions container when sidebar is collapsed to prevent empty space and hotspots */
  .site-header.is-collapsed .header-actions {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Center the login button when sidebar is collapsed and signup is hidden */
  .site-header.is-collapsed .header-auth__links {
    justify-content: center;
  }

  .header-quick-dropdown .header-dropdown {
    right: 0;
    left: auto;
  }

  .floating-notifications {
    top: var(--floating-notifications-offset, 2rem);
    right: 2rem;
    left: auto;
    bottom: auto;
    align-items: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-logo__image,
  .header-quick-button,
  .header-dropdown,
  .mobile-bottom-nav__link,
  .header-user,
  .header-nav__link {
    transition-duration: 0ms;
  }

  .site-header.is-animating .header-nav__item,
  .site-header.is-animating .header-auth__link,
  .site-header.is-animating .header-user {
    animation: none;
  }
}

.mobile-bottom-nav__link .fa-solid,
.mobile-bottom-nav__link:where(:hover, :focus-visible, :active) .fa-solid,
.mobile-bottom-nav__link[aria-pressed="true"] .fa-solid {
  color: var(--header-text, #234435) !important;
  fill: currentColor !important;
  transition: none;
}
