  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    /* Acima do conteúdo/sticky da página, mas ABAIXO de todos os
       overlays de modal (menor overlay usa z 900) para nunca cobrir um modal. */
    z-index: 800;
    transition: transform 220ms cubic-bezier(.22,.9,.24,1), opacity 180ms ease, box-shadow 180ms ease;
    will-change: transform;
  }

  #site-header-spacer {
    display: block;
    width: 100%;
    height: var(--angg-header-height, 72px);
    flex: 0 0 auto;
  }

  .header.is-floating {
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.16);
  }

  .header.is-hidden {
    transform: translateY(calc(-100% - 10px));
  }

  .header.is-locked {
    transform: translateY(0);
  }

  #header-stats .coin-value {
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .header {
      transition: none;
    }
  }

  /* Make header logo look like plain text (remove default link styling) */
  .logo { text-decoration: none; color: inherit; display: inline-flex; align-items: center; flex: 1 1 auto; min-width: 0; container-type: inline-size; }
  .logo:hover, .logo:focus { text-decoration: none; }
  .logo h1 { margin: 0; line-height: 1; font-size: clamp(0.68rem, 4.5vw, 1.05rem); font-size: clamp(0.68rem, 14.5cqw, 1.05rem); letter-spacing: clamp(0.2px, 0.3cqw, 1px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  .profile-menu { position: relative; }
  .profile-menu .dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: transparent;
    color: var(--text, #111);
    border-radius: 10px;
    overflow: visible;
    pointer-events: auto;
    z-index: 12010;
  }
  /* portal-based container (when we render the dropdown into body) */
  #dropdown-portal {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 12020;
  }
  #dropdown-portal .dropdown-inner,
  .profile-menu .dropdown .dropdown-inner {
    background: var(--surface, #0b0d10);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: min(520px, calc(100vh - 96px));
    overscroll-behavior: contain;
    scrollbar-width: thin;
    transform-origin: top right;
    transform: scaleY(0);
    opacity: 0;
    visibility: hidden;
    transition: transform 220ms cubic-bezier(.2,.9,.2,1), opacity 160ms ease;
    box-shadow: 0 12px 30px rgba(2,6,23,0.5);
    pointer-events: auto;
  }
  #dropdown-portal .dropdown-inner {
    position: absolute;
    right: 0;
    top: 0;
    min-width: 180px;
  }
  #dropdown-portal .dropdown-inner a,
  .profile-menu .dropdown .dropdown-inner a { display:block; padding:8px 12px; color:inherit; text-decoration:none; }
  #dropdown-portal .dropdown-inner a:hover,
  .profile-menu .dropdown .dropdown-inner a:hover { background: rgba(255,255,255,0.02); }

  /* When active inside portal, allow visible and interaction */
  #dropdown-portal.open { pointer-events: auto; }
  #dropdown-portal.open .dropdown-inner { transform: scaleY(1) !important; opacity:1 !important; visibility:visible !important; }

  /* reduce jump on small screens */
  @media (max-width:900px) {
    .profile-menu .dropdown { right: 6px; left: auto; min-width: 160px; }
  }
