/* =======================================================
   FOTOLINKER — HEADER + MENU (final clean version)
======================================================= */

/* === HEADER === */
.site-header {
  width: 100%;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: relative; 
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  font-family: 'Poppins', sans-serif;
  position: relative;
}

body:has(.hero-home) .site-header {
  background: transparent;
  border-bottom: none;
}

body:has(.hero-home) .header-inner {
  max-width: 1480px;
  padding: 14px 24px 12px;
}

/* === LOGO === */
.logo {
  color: var(--accent-color);
  text-decoration: none;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
}

.logo,
.logo svg {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.logo:focus,
.logo:active,
.logo:hover,
.logo:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Zapobiega „tap highlight” na mobile */
.logo,
.logo svg {
  -webkit-tap-highlight-color: transparent;
}

/* Drobiazg: obrazek nie “dociąga” linii bazowej */
.logo svg {
  display: block;
}

.logo-mark {
  display: block;
  flex: 0 0 auto;
}

.logo-mark svg {
  display: block;
  width: 100%;
  height: auto;
}

.logo img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
}

body.dark-mode .logo-mark svg,
body.dark-theme .logo-mark svg,
:root[data-theme="dark"] .logo-mark svg,
body.dark-mode .logo-mark img,
body.dark-theme .logo-mark img,
:root[data-theme="dark"] .logo-mark img {
  filter: invert(1) brightness(1.15);
}

.logo-mark--full {
  width: clamp(126px, 11vw, 168px);
}

.logo-mark--mobile {
  display: none;
  width: clamp(96px, 29vw, 136px);
}

.logo-mark--full img {
  max-height: 32px;
  width: auto;
}

.logo-mark--mobile img {
  max-height: 28px;
  width: auto;
}

/* === NAVIGATION === */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

body:has(.hero-home) .nav {
  gap: 30px;
}

.nav a,
.nav .nav-link {
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav a,
.nav .nav-link,
.nav-summary,
.nav-submenu a,
.menu-toggle {
  -webkit-tap-highlight-color: transparent;
}

.nav .nav-link {
  border: 0;
  background: transparent;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  padding: 0;
}

.nav a:hover,
.nav .nav-link:hover {
  color: var(--accent-color);
}

body:has(.hero-home) .logo {
  color: var(--home-header-logo);
  font-weight: 700;
}

body:has(.hero-home) .nav a,
body:has(.hero-home) .nav .nav-link {
  color: var(--home-header-link);
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
}

body:has(.hero-home) .nav a:hover,
body:has(.hero-home) .nav .nav-link:hover {
  color: var(--home-header-link-hover);
  opacity: 1;
}

body:has(.hero-home) .nav > a:first-child {
  color: var(--home-header-link-active);
}

.nav-item--submenu {
  position: relative;
}

.nav-summary {
  display: block;
  width: auto;
  padding: 0;
  line-height: inherit;
  min-height: 0;
  list-style: none;
}

.nav-summary::marker {
  content: "";
}

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

.nav-summary::after {
  display: none !important;
  content: none !important;
}

.nav-item--submenu[open] .nav-summary::after {
  display: none !important;
  content: none !important;
}

.nav-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 3600;
}

.nav-item--submenu[open] .nav-submenu {
  display: grid;
  gap: 2px;
}

.nav-submenu a {
  display: block;
  padding: 10px 12px;
  border-radius: 0;
  line-height: 1.3;
  text-align: left;
}

.nav-submenu a:hover,
.nav-submenu a:focus-visible,
.nav-submenu a.is-active {
  background: transparent;
  color: var(--accent-color);
  border: 0;
  box-shadow: none;
}

body.dark-mode .nav-submenu a.is-active,
body.dark-theme .nav-submenu a.is-active {
  color: var(--text-color);
}

.nav a.is-active,
.nav .nav-link.is-active,
.nav-item--submenu.is-active > .nav-summary,
.nav-item--submenu.is-current > .nav-summary {
  color: var(--accent-color);
}

body[data-page-chrome="home"] .nav a.is-active,
body[data-page-chrome="home"] .nav .nav-link.is-active,
body[data-page-chrome="home"] .nav-item--submenu.is-active > .nav-summary,
body[data-page-chrome="home"] .nav-item--submenu.is-current > .nav-summary {
  color: var(--home-header-link-active);
}

/* === HEADER CONTROLS === */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

body:has(.hero-home) .header-controls {
  gap: 14px;
}

/* === NOTIFICATIONS BELL === */
.menu-notifications {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  z-index: 99;
}

.notifications-toggle {
  width: 38px;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: none;
  transition: box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.notifications-toggle.is-attention {
  border-color: color-mix(in oklab, var(--accent-color) 55%, var(--border-color));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent-color) 18%, transparent);
}

.notifications-toggle:hover {
  background: var(--hover-bg-soft) !important;
}

.notifications-toggle .notifications-icon {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
  transition: filter .2s ease, opacity .2s ease;
}

.notifications-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--accent-color);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--card-bg);
}

body:has(.hero-home) .notifications-toggle {
  background: var(--home-header-control-bg);
  border-color: var(--home-header-control-border);
  border-width: 0.8px;
  box-shadow: none;
  width: 34px;
  height: 34px;
}

body:has(.hero-home) .notifications-toggle:hover {
  background: var(--home-header-control-hover) !important;
  border-color: var(--home-header-control-border);
}

body:has(.hero-home) .notifications-toggle.is-attention {
  border-color: color-mix(in oklab, var(--accent-color) 55%, var(--home-header-control-border));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent-color) 18%, transparent);
}

:root:not([data-theme="dark"]) body:has(.hero-home) .notifications-toggle .notifications-icon {
  filter: brightness(0) invert(0) !important;
  opacity: .65;
}

:root[data-theme="dark"] body:has(.hero-home) .notifications-toggle .notifications-icon {
  filter: brightness(0) invert(1) brightness(0.7) contrast(1.12) !important;
  opacity: 1;
}

.menu-notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  width: min(340px, calc(100vw - 24px));
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

.menu-notifications-dropdown.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .menu-notifications-list,
  .menu-notification-item,
  .menu-notifications-head,
  .menu-notifications-empty,
  .menu-notifications-all {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .menu-notification-title,
  .menu-notification-body,
  .menu-notification-date {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

.menu-notifications-head {
  padding: 12px 14px 10px;
  color: var(--text-color);
}

.menu-notifications-list {
  display: flex;
  flex-direction: column;
}

.menu-notification-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  color: var(--text-color);
  text-decoration: none;
  border-top: 1px solid color-mix(in oklab, var(--border-color) 70%, transparent);
}

.menu-notification-item:hover {
  background: var(--hover-bg-soft);
  color: var(--text-color);
}

.menu-notification-item.is-unread {
  background: color-mix(in oklab, var(--accent-color) 8%, var(--card-bg));
}

.menu-notification-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
}

.menu-notification-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-color);
  border: 1px solid color-mix(in oklab, var(--accent-color) 38%, var(--border-color) 62%);
  background: color-mix(in oklab, var(--accent-color) 16%, var(--card-bg));
}

.menu-notification-body {
  font-size: 13px;
  color: var(--text-color);
  opacity: 0.86;
}

.menu-notification-date {
  font-size: 12px;
  color: var(--muted-text, #6b7280);
}

.menu-notifications-empty {
  padding: 12px 14px;
  color: var(--muted-text, #6b7280);
  border-top: 1px solid color-mix(in oklab, var(--border-color) 70%, transparent);
}

.menu-notifications-all {
  display: block;
  padding: 12px 14px;
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.menu-notifications-all:hover {
  background: var(--hover-bg-soft);
  color: var(--accent-color);
}

/* === USER AVATAR === */
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  cursor: pointer;
}

body:has(.hero-home) .user-avatar,
body:has(.hero-home) .theme-toggle {
  background: var(--home-header-control-bg);
  border-color: var(--home-header-control-border);
  border-width: 0.8px;
  box-shadow: none;
  width: 34px;
  height: 34px;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}

body:has(.hero-home) .user-avatar:hover,
body:has(.hero-home) .theme-toggle:hover {
  background: var(--home-header-control-hover) !important;
  border-color: var(--home-header-control-border);
}

body:has(.hero-home) .theme-toggle:focus-visible {
  outline: 1px solid var(--home-header-control-border);
  outline-offset: 2px;
}

:root:not([data-theme="dark"]) body:has(.hero-home) .theme-toggle img {
  filter: brightness(1.12) saturate(0.8) contrast(0.92);
  opacity: 0.78;
}

:root[data-theme="dark"] body:has(.hero-home) .theme-toggle img {
  filter: brightness(0.88) contrast(0.92);
  opacity: 0.9;
}

.user-avatar img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  transition: filter 0.2s ease;
}

/* Avatar użytkownika — pełne kółko */
.menu-user .user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* 🔥 wypełnia koło */
  border-radius: 50%;
}

/* IKONA defaultowa — mniejsza */
:root:not([data-theme="dark"]) body .notifications-toggle .notifications-icon {
  filter: invert(0.12) contrast(0.94) !important;
  opacity: .92;
}

/* Jasny avatar w dark mode – mocny, jak słoneczko */
:root[data-theme="dark"] body .notifications-toggle .notifications-icon {
  filter: brightness(0) invert(1) brightness(1.95) contrast(1) !important;
  opacity: .92;
}

/* === USER MENU DROPDOWN === */
.menu-user {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
}

.menu-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow);
  width: max-content;
  min-width: 196px;
  max-width: min(240px, calc(100vw - 24px));
  display: none;
  flex-direction: column;
  padding: 4px 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.menu-user-dropdown.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.menu-user-dropdown a {
  display: block;
  padding: 8px 14px;
  color: var(--text-color);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.menu-user-dropdown a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

.menu-user-header {
  display: grid;
  gap: 2px;
  padding: 12px 14px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid color-mix(in oklab, var(--border-color) 80%, transparent);
}

.menu-user-header__name {
  color: var(--text-color);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.menu-user-header__meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.menu-user-controls {
  margin: 6px 8px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
}

.menu-user-controls .theme-toggle {
  margin: 0;
  margin-left: auto;
  flex: 0 0 auto;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
}

.menu-lang-switch {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  height: 38px;
  min-height: 38px;
  width: auto;
  max-width: max-content;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card-bg);
}

.menu-lang-switch__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-height: 0;
  box-sizing: border-box;
  padding: 0 12px;
  min-width: 38px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(1px);
  color: var(--text-color);
  text-decoration: none;
}

.menu-lang-switch__option + .menu-lang-switch__option {
  border-left: 1px solid color-mix(in oklab, var(--border-color) 78%, transparent);
}

.menu-lang-switch__option:hover {
  color: var(--accent-color);
}

.menu-lang-switch__option.is-active {
  background: color-mix(in oklab, var(--accent-color) 14%, var(--card-bg));
  color: var(--accent-color);
}

.menu-user-dropdown .menu-lang-switch__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 12px;
  line-height: 1;
  transform: none;
  font-size: 13px;
}

.menu-separator {
  height: 1px;
  margin: 4px 0;
  background: color-mix(in oklab, var(--border-color) 80%, transparent);
}

/* === DARK/LIGHT TOGGLE === */
.theme-toggle {
  width: 38px;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  transition: background .2s, border-color .2s;
}

.theme-toggle:hover {
  background: var(--bg-color);
}

.theme-toggle img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.theme-toggle:hover {
  background: var(--hover-bg-soft) !important;
}
/* Jasne słońce w dark mode */
:root:not([data-theme="dark"]) body .theme-toggle {
  border-color: color-mix(in oklab, var(--border-color) 72%, white 28%);
}

body.dark-theme #sunIcon {
  filter: brightness(3) saturate(1.4) hue-rotate(-10deg);
}

/* === DESKTOP — hover dla avatara === */
@media (min-width: 993px) {
  .menu-user:hover .menu-user-dropdown {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }

  .menu-user::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 14px;
  }
}

/* === HAMBURGER === */
.menu-toggle {
  display: none;
  position: relative;
  width: 50px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  justify-content: center;
  align-items: center;
}

.menu-toggle span {
  position: absolute;
  left: 50%;
  width: 24px;
  height: 3px;
  background: var(--text-color);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Górna kreska */
.menu-toggle span:nth-child(1) {
  top: 14px;
}

/* Środkowa kreska */
.menu-toggle span:nth-child(2) {
  top: 20px;
}

/* Dolna kreska */
.menu-toggle span:nth-child(3) {
  top: 26px;
}

/* === X – obrót bez ucinania (obrót wokół środka przycisku) === */
.menu-toggle.active span:nth-child(1) {
  transform: translateX(-50%) rotate(45deg);
  top: 20px;
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateX(-50%) rotate(-45deg);
  top: 20px;
}

/* === MOBILE === */
@media (max-width: 992px) {
  .header-inner {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body:has(.hero-home) .header-inner {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header-inner {
    position: relative;
  }

  .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translateX(-6px);
    max-width: calc(100vw - 180px);
    z-index: 2;
  }

  .logo-mark--full {
    display: none;
  }

  .logo-mark--mobile {
    display: block;
  }

  .header-controls {
    margin-left: auto;
    gap: 8px;
  }

  .menu-notifications {
    transform: translateX(2px);
    position: relative;
    z-index: 5;
  }

  .menu-toggle {
    display: flex;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
  }

  .nav {
    display: none;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    margin: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    transform: none;
    flex-direction: column;
    background: var(--card-bg);
    z-index: 3500;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
    align-items: stretch;
    gap: 2px;
  }

  body:has(.hero-home) .nav {
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    overflow-x: hidden;
    transform: none;
    align-items: stretch;
    gap: 2px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--home-header-control-border);
    border-radius: 18px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
  }

  body:has(.hero-home) .nav a,
  body:has(.hero-home) .nav .nav-link {
    display: block;
    padding: 11px 12px;
    border-radius: 12px;
    text-align: left;
    line-height: 1.3;
  }

  body:has(.hero-home) .nav a:hover,
  body:has(.hero-home) .nav a:focus-visible,
  body:has(.hero-home) .nav .nav-link:hover,
  body:has(.hero-home) .nav .nav-link:focus-visible {
    background: rgba(15, 23, 42, 0.05);
    opacity: 1;
  }

  .nav-item--submenu {
    width: 100%;
    display: block;
    align-items: stretch;
  }

  .nav-summary {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 11px 12px;
    line-height: 1.3;
    text-align: left;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .nav-submenu {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-item--submenu[open] > .nav-submenu {
    display: block;
    margin: 2px 0 0 16px;
  }

  .nav-submenu a {
    text-align: left;
    border-radius: 0;
    background: transparent;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .nav.active {
    display: flex;
  }

  .nav,
  .nav *,
  .nav a,
  .nav .nav-link,
  .nav .nav-summary {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  .nav a,
  .nav .nav-link,
  .nav .nav-summary {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* =======================================================
   FINAL FIX — pełny X + jasne słońce
======================================================= */

/*  Ikona słońca — bardzo jasna w trybie dark */
body.dark-theme #sunIcon {
  filter: brightness(5) invert(1) contrast(1.3) saturate(1.5);
  opacity: 0.95;
}

/*  Księżyc — lekko przygaszony w trybie dark */
body.dark-theme #moonIcon {
  filter: brightness(0.8);
}

body:has(.hero-home) .menu-user-dropdown .theme-toggle {
  width: 38px;
  height: 38px;
  background: var(--card-bg);
  border-color: var(--border-color);
  border-width: 1px;
  box-shadow: none;
}

:root[data-theme="dark"] body:has(.hero-home) #sunIcon {
  filter: brightness(1.9) invert(0.94) contrast(0.96) saturate(0.9);
  opacity: 0.86;
}

:root[data-theme="dark"] body:has(.hero-home) #moonIcon {
  filter: brightness(0.76) contrast(0.94);
  opacity: 0.86;
}

:root:not([data-theme="dark"]) body:has(.hero-home) #sunIcon,
:root:not([data-theme="dark"]) body:has(.hero-home) #moonIcon {
  opacity: 0.82;
}

:root:not([data-theme="dark"]) body:has(.hero-home) #themeToggle #moonIcon {
  filter: brightness(1.12) saturate(0.8) contrast(0.92);
  opacity: 0.78;
}

/* === HOME CHROME VARIANT FOR SPECIFIC PUBLIC PAGES === */
body[data-page-chrome="market"] .logo {
  color: var(--home-header-logo);
}

body[data-page-chrome="home"] .site-header {
  background: transparent;
  border-bottom: none;
}

body[data-page-chrome="home"] .header-inner {
  max-width: 1480px;
  padding: 14px 24px 12px;
}

body[data-page-chrome="home"] .logo {
  color: var(--home-header-logo);
  font-weight: 700;
}

body[data-page-chrome="home"] .nav {
  gap: 30px;
}

body[data-page-chrome="home"] .nav a,
body[data-page-chrome="home"] .nav .nav-link {
  color: var(--home-header-link);
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
}

body[data-page-chrome="home"] .nav a:hover,
body[data-page-chrome="home"] .nav .nav-link:hover {
  color: var(--home-header-link-hover);
  opacity: 1;
}

body[data-page-chrome="home"] .nav > a:first-child {
  color: var(--home-header-link-active);
}

body[data-page-chrome="home"] .header-controls {
  gap: 14px;
}

body[data-page-chrome="home"] .notifications-toggle {
  background: var(--home-header-control-bg);
  border-color: var(--home-header-control-border);
  border-width: 0.8px;
  box-shadow: none;
  width: 34px;
  height: 34px;
}

body[data-page-chrome="home"] .notifications-toggle:hover {
  background: var(--home-header-control-hover) !important;
  border-color: var(--home-header-control-border);
}

body[data-page-chrome="home"] .notifications-toggle.is-attention {
  border-color: color-mix(in oklab, var(--accent-color) 55%, var(--home-header-control-border));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent-color) 18%, transparent);
}

:root:not([data-theme="dark"]) body[data-page-chrome="home"] .notifications-toggle .notifications-icon {
  filter: brightness(0) invert(0) !important;
  opacity: .65;
}

:root[data-theme="dark"] body[data-page-chrome="home"] .notifications-toggle .notifications-icon {
  filter: brightness(0) invert(1) brightness(0.7) contrast(1.12) !important;
  opacity: 1;
}

body[data-page-chrome="home"] .user-avatar,
body[data-page-chrome="home"] .theme-toggle {
  background: var(--home-header-control-bg);
  border-color: var(--home-header-control-border);
  border-width: 0.8px;
  box-shadow: none;
}

body[data-page-chrome="home"] .menu-user-dropdown .theme-toggle {
  width: 38px;
  height: 38px;
  background: var(--card-bg);
  border-color: var(--border-color);
  border-width: 1px;
  box-shadow: none;
}

body[data-page-chrome="home"] .user-avatar:hover,
body[data-page-chrome="home"] .theme-toggle:hover {
  background: var(--home-header-control-hover) !important;
  border-color: var(--home-header-control-border);
}

body[data-page-chrome="home"] .theme-toggle:focus-visible {
  outline: 1px solid var(--home-header-control-border);
  outline-offset: 2px;
}

:root:not([data-theme="dark"]) body[data-page-chrome="home"] .theme-toggle img {
  filter: brightness(1.12) saturate(0.8) contrast(0.92);
  opacity: 0.78;
}

:root[data-theme="dark"] body[data-page-chrome="home"] .theme-toggle img {
  filter: brightness(0.88) contrast(0.92);
  opacity: 0.9;
}

:root .site-header .user-avatar img.site-header-avatar--default {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border-radius: 0;
  mix-blend-mode: normal !important;
}

:root[data-theme="dark"] .site-header .user-avatar img.site-header-avatar--default,
html[data-theme="dark"] .site-header .user-avatar img.site-header-avatar--default,
body.dark-mode .site-header .user-avatar img.site-header-avatar--default,
body.dark-theme .site-header .user-avatar img.site-header-avatar--default,
body.theme-dark .site-header .user-avatar img.site-header-avatar--default {
  mix-blend-mode: normal !important;
  filter: invert(1) brightness(1.15) contrast(0.95) !important;
  opacity: 0.92;
}

@media (max-width: 992px) {
  body[data-page-chrome="home"] .header-inner {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  body[data-page-chrome="home"] .header-controls {
    gap: 4px;
  }

  body[data-page-chrome="home"] .nav {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    overflow-x: hidden;
    transform: none;
    align-items: stretch;
    gap: 2px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--home-header-control-border);
    border-radius: 18px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
  }

  body[data-page-chrome="home"] .nav a,
  body[data-page-chrome="home"] .nav .nav-link {
    display: block;
    padding: 11px 12px;
    border-radius: 12px;
    text-align: left;
    line-height: 1.3;
  }

  body[data-page-chrome="home"] .nav .nav-summary {
    text-align: left;
    justify-content: flex-start;
  }

  body[data-page-chrome="home"] .nav a:hover,
  body[data-page-chrome="home"] .nav a:focus-visible,
  body[data-page-chrome="home"] .nav .nav-link:hover,
  body[data-page-chrome="home"] .nav .nav-link:focus-visible {
    background: rgba(15, 23, 42, 0.05);
    opacity: 1;
  }

  body[data-page-chrome="home"] .logo {
    max-width: calc(100vw - 180px);
    top: calc(50% + 1px);
  }

  body[data-page-chrome="home"] .logo-mark--mobile {
    width: clamp(100px, 30vw, 140px);
  }

  body[data-page-chrome="home"] .menu-notifications {
    transform: translateX(3px);
    position: relative;
    z-index: 5;
  }

  body[data-page-chrome="home"] .menu-user-dropdown .theme-toggle {
    width: 38px;
    height: 38px;
    background: var(--card-bg);
    border-color: var(--border-color);
    border-width: 1px;
    box-shadow: none;
  }
}

@media (max-width: 992px) {
  .menu-notifications-dropdown {
    right: -50px;
    width: min(340px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    z-index: 1000;
  }

  .menu-notifications-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
}
