.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--color-header-surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width:min(var(--page-max-width), calc(100% - 2 * var(--page-gutter)));
  max-width:var(--page-max-width);
  height: var(--header-height);
  margin: auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 780;
  font-size: 27px;
  letter-spacing: -1.2px;
  flex-shrink: 0;
}
.brand-sub {
  color: var(--accent);
  transition: color .35s ease;
}
#account-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#account-nav .btn {
  white-space: nowrap;
}
.user-button {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 7px 12px 7px 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.user-button > span:nth-child(2) {
  max-width: 145px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
.header-connect { display: none; }
.header-inner {
    gap: 35px;
  }
}
@media (max-width: 768px) {
.site-header {
    top: var(--header-offset);
    width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-width: none;
    margin: var(--header-offset) auto 0;
    border: 1px solid var(--nav-pill-border);
    border-radius: var(--radius-panel);
    background: var(--nav-pill-background);
    box-shadow: 0 5px 24px #15364d12;
    transition: background-color .3s ease, border-color .3s ease, color .3s ease;
  }
.header-inner {
    height: calc(var(--header-height) - 2px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 42px;
    gap: 0 8px;
    padding: 6px 20px;
  }
.header-identity {
    grid-column: 1;
    grid-row: 1;
  }
.brand {
    font-size: 21px;
  }
#account-nav {
    grid-column: 2;
    grid-row: 1;
  }
#account-nav .btn, .user-button {
    border-radius: max(var(--radius-control), calc(var(--radius-panel) - 8px));
  }
.user-button {
    font-size: 12px;
    padding: 6px 10px 6px 6px;
  }
.user-button > span:nth-child(2) {
    max-width: 80px;
  }
.user-button .avatar {
    width: 27px;
    height: 27px;
    font-size: 12px;
  }
}
@media (max-width: 360px) {
.header-inner {
    padding: 0 16px;
    column-gap: 8px;
    padding-block: 6px;
  }
.brand {
    font-size: 18px;
  }
#account-nav .btn {
    font-size: 12px;
    padding: 9px;
    gap: 6px;
  }
}

.header-identity { display:grid;min-width:0;align-items:center; }
.header-identity > * { grid-area:1 / 1; }
.header-page-title { display:none;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:18px;font-weight:700; }
@media(max-width:768px) {
  .header-page-title { display:block;visibility:hidden;opacity:0;line-height:1.4;transform-origin:top left; }
  .header-identity > * { transition:none; }
  .site-header.is-page-title .brand { visibility:visible;opacity:1; }
  .site-header.is-page-title .header-page-title { visibility:visible;opacity:1;transform:none; }
}

@media(min-width:769px){.header-inner{width:min(var(--page-max-width),calc(100% - 2 * var(--page-gutter)));padding-left:0;padding-right:0;}}

.brand { gap:8px; }
.brand-icon { display:block;width:40px;height:40px;object-fit:contain;flex-shrink:0;image-rendering:pixelated; }
@media(max-width:768px) { .header-inner { padding-inline:16px; } .brand { gap:6px; } .brand-icon { width:32px;height:32px; } }
@media(max-width:360px) { .header-inner { padding-inline:10px; } .brand { font-size:16px; } .brand-icon { width:28px;height:28px; } }

@media(max-width:768px) {
 .site-header .header-inner { width:100%;padding-inline:12px; }
 .site-header.is-title-moving .brand { visibility:visible; }
}

@media(max-width:768px) {
 .site-header {

  top:calc(var(--header-rest-offset,0px) + (var(--header-offset) - var(--header-rest-offset,0px)) * var(--header-pill-progress,0));
  width:calc(100% - (24px + env(safe-area-inset-left,0px) + env(safe-area-inset-right,0px)) * var(--header-pill-progress,0));
  max-width:none;
  margin:0 auto;
  border-color:color-mix(in srgb,var(--nav-pill-border) calc(100% * var(--header-pill-progress,0)),transparent);
  border-radius:calc(var(--radius-panel) * var(--header-pill-progress,0));
  box-shadow:0 5px 24px rgb(21 54 77 / calc(.07 * var(--header-pill-progress,0)));
  transition:background-color .2s ease,color .2s ease;
 }
}
