/*
  HK Universe v7.1.2 – Header Layout Recovery Fix
  Diese Datei wird auf der Startseite nach den alten Header-Dateien geladen
  und überschreibt die alten Grid-/Wrap-Regeln sauber.
*/

body .topbar.hk-header-recovered{
  position:fixed;
  inset:0 0 auto 0;
  height:var(--hk-top);
  min-height:var(--hk-top);
  z-index:60;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:nowrap!important;
  gap:18px!important;
  padding:10px 22px!important;
  box-sizing:border-box;
  overflow:visible!important;
  background:rgba(4,8,22,.88);
  backdrop-filter:blur(22px);
  border-bottom:1px solid var(--hk-line);
}

body .topbar.hk-header-recovered > *{
  min-width:0;
  grid-column:auto!important;
  grid-row:auto!important;
  justify-self:auto!important;
  align-self:center!important;
}

body .topbar.hk-header-recovered .brand{
  order:1;
  flex:0 0 var(--hk-left);
  width:var(--hk-left);
  max-width:var(--hk-left);
  display:flex!important;
  align-items:center!important;
  gap:12px;
  overflow:hidden;
  color:white;
  z-index:2;
}

body .topbar.hk-header-recovered .brand-core{
  flex:0 0 48px;
}

body .topbar.hk-header-recovered .brand-text{
  min-width:0;
  display:grid;
  line-height:1.08;
}

body .topbar.hk-header-recovered .brand-text strong,
body .topbar.hk-header-recovered .brand-text small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

body .topbar.hk-header-recovered .search{
  order:2;
  flex:1 1 520px;
  min-width:220px;
  max-width:920px;
  display:flex!important;
}

body .topbar.hk-header-recovered .creator-top-link{
  order:3;
  flex:0 0 auto;
  white-space:nowrap;
  color:white;
  z-index:2;
}

body .topbar.hk-header-recovered .system-time{
  order:4;
  flex:0 0 auto;
  white-space:nowrap;
  z-index:2;
}

body .topbar.hk-header-recovered .topbar-user-zone{
  order:5;
  margin-left:auto;
  flex:0 0 auto;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  gap:10px!important;
  min-width:0!important;
  max-width:min(520px,42vw);
  overflow:visible!important;
  z-index:70;
}

body .topbar.hk-header-recovered .topbar-user-zone .hk-notification-bell{
  order:1;
  flex:0 0 auto;
  position:relative;
  z-index:75;
}

body .topbar.hk-header-recovered .topbar-user-zone .hk-identity-chip{
  order:2;
  flex:0 1 auto;
  min-width:0!important;
  max-width:420px!important;
  width:auto!important;
  justify-self:auto!important;
  position:relative;
  z-index:74;
}

body .topbar.hk-header-recovered .topbar-user-zone .notify-button{
  width:46px!important;
  height:46px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:17px!important;
  line-height:1!important;
}

body .topbar.hk-header-recovered .topbar-user-zone .notify-button span{
  top:-8px!important;
  right:-8px!important;
}

body .topbar.hk-header-recovered .identity-info{
  min-width:0;
}

body .topbar.hk-header-recovered .identity-info strong{
  max-width:150px;
}

body .topbar.hk-header-recovered .identity-actions{
  flex:0 0 auto;
  margin-left:auto;
}

body .topbar.hk-header-recovered .notify-panel{
  position:fixed!important;
}

/* Kein Floating-Verhalten innerhalb des Headers */
body .topbar.hk-header-recovered .hk-identity-floating{
  position:static!important;
}

/* Desktop enger */
@media(max-width:1320px){
  body .topbar.hk-header-recovered{
    gap:12px!important;
    padding-inline:16px!important;
  }
  body .topbar.hk-header-recovered .brand{
    flex-basis:230px;
    width:230px;
    max-width:230px;
  }
  body .topbar.hk-header-recovered .search{
    flex-basis:340px;
  }
  body .topbar.hk-header-recovered .identity-actions a{
    padding:7px 9px;
  }
}

/* Tablet: Suche und Uhr raus, Profil/Glocke bleiben rechts */
@media(max-width:1080px){
  body .topbar.hk-header-recovered{
    gap:10px!important;
  }
  body .topbar.hk-header-recovered .search,
  body .topbar.hk-header-recovered .system-time{
    display:none!important;
  }
  body .topbar.hk-header-recovered .brand{
    flex:1 1 auto;
    width:auto;
    max-width:none;
  }
  body .topbar.hk-header-recovered .creator-top-link{
    margin-left:auto;
  }
  body .topbar.hk-header-recovered .topbar-user-zone{
    margin-left:0;
    max-width:430px;
  }
}

/* Kleines Tablet: Künstler-Link raus */
@media(max-width:860px){
  body .topbar.hk-header-recovered .creator-top-link{
    display:none!important;
  }
  body .topbar.hk-header-recovered .topbar-user-zone .identity-actions a:not(.primary){
    display:none!important;
  }
  body .topbar.hk-header-recovered .topbar-user-zone{
    max-width:320px;
  }
}

/* Handy: nur Logo, Glocke und Profil-Avatar */
@media(max-width:680px){
  body .topbar.hk-header-recovered{
    height:72px;
    min-height:72px;
    padding:8px 10px!important;
    gap:8px!important;
  }
  body .topbar.hk-header-recovered .brand-core{
    flex-basis:42px;
    width:42px;
    height:42px;
    border-radius:15px;
  }
  body .topbar.hk-header-recovered .brand-text strong{
    font-size:.94rem;
    max-width:130px;
  }
  body .topbar.hk-header-recovered .brand-text small{
    display:none;
  }
  body .topbar.hk-header-recovered .topbar-user-zone{
    gap:8px!important;
    max-width:none;
  }
  body .topbar.hk-header-recovered .topbar-user-zone .identity-info,
  body .topbar.hk-header-recovered .topbar-user-zone .identity-actions{
    display:none!important;
  }
  body .topbar.hk-header-recovered .topbar-user-zone .hk-identity-chip{
    padding:5px!important;
    border-radius:18px!important;
    min-width:auto!important;
  }
  body .topbar.hk-header-recovered .identity-avatar,
  body .topbar.hk-header-recovered .identity-orb{
    width:42px;
    height:42px;
    border-radius:15px;
  }
  body .topbar.hk-header-recovered .topbar-user-zone .notify-button{
    width:42px!important;
    height:42px!important;
    border-radius:15px!important;
  }
}

/* Sehr schmal: Text neben Logo ausblenden */
@media(max-width:440px){
  body .topbar.hk-header-recovered .brand{
    flex:1 1 0;
  }
  body .topbar.hk-header-recovered .brand-text{
    display:none;
  }
}
