/* KS header uses the existing shared colour, spacing and theme tokens.
   Scoped rules leave the public landing header and other pages unchanged. */
.ks-topbar.ks-topbar-quick-access {
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: .85rem;
}
.ks-topbar-quick-access .ks-brand { min-width: 0; }
.ks-topbar-quick-access .ks-brand img { max-width: 12.5rem; width: 100%; }
.ks-header-shortcuts { display: flex; align-items: center; gap: .65rem; }
.ks-header-icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ks-header-shortcut, .ks-topbar-quick-access .ks-menu-button {
  position: relative; display: inline-flex; justify-content: center; align-items: center;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: 12px;
  color: var(--ks-text); background: transparent; text-decoration: none;
}
.ks-header-shortcut:hover, .ks-header-shortcut[aria-current="page"] {
  color: var(--ks-text); background: var(--ks-primary-soft); border-color: var(--ks-border);
}
.ks-header-shortcut:focus-visible, .ks-topbar-quick-access .ks-menu-button:focus-visible {
  outline: 3px solid var(--ks-primary); outline-offset: 3px;
}
.ks-header-shortcut .ks-badge {
  position: absolute; inset: -2px -3px auto auto; min-width: 19px; height: 19px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--ks-bg-elevated); border-radius: 999px;
  background: #b81e48; color: #fff; font-size: 10px; font-weight: 800; line-height: 1;
}
[data-ks-friend-count][hidden], [data-ks-message-count][hidden], [data-ks-message-request-count][hidden], [data-ks-notification-count][hidden], [data-ks-alert-count][hidden], [data-ks-count-status][hidden] { display: none !important; }
.ks-top-account { min-width: 0; }
.ks-top-account .ks-account-chip { min-height: 44px; }
.ks-top-account .ks-account-username { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.ks-global-search.ks-menu-search { display: flex; margin: .5rem .2rem 1rem; }
.ks-menu-search .ks-search-icon { left: .8rem; }
.ks-menu-search .ks-header-icon { width: 19px; height: 19px; }
.ks-menu-search input { padding-right: .8rem; }
.ks-menu-preferences { display: grid; gap: .5rem; margin-bottom: .75rem; }
.ks-menu-preferences .ks-btn { min-height: 44px; justify-content: flex-start; font-size: .85rem; }
.ks-friend-request-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.ks-friend-request-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; }
.ks-friend-request-identity { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.ks-friend-request-initial { width: 48px; height: 48px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--ks-primary-soft); color: var(--ks-text); font-weight: 750; }
.ks-friend-request-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
@media (max-width: 760px) {
  .ks-topbar.ks-topbar-quick-access { padding-inline: .55rem; gap: .5rem; }
  .ks-header-shortcuts { gap: .3rem; }
  .ks-top-account .ks-account-username { display: none; }
  .ks-top-account .ks-account-chip { padding: 0; width: 44px; justify-content: center; }
}
@media (max-width: 420px) {
  .ks-topbar.ks-topbar-quick-access { padding-inline: .35rem; gap: .25rem; }
  .ks-header-shortcuts { gap: .15rem; }
  .ks-topbar-quick-access .ks-brand img { max-height: 2rem; }
  html[data-ks-discreet="true"] .ks-topbar-quick-access .ks-brand img { display: none; }
  html[data-ks-discreet="true"] .ks-topbar-quick-access .ks-brand::after { content: "KS"; }
}
@media (prefers-reduced-motion: reduce) { .ks-header-shortcut { transition: none; } }
