/* R7.10.182 — normalized icon assets for the approved 9-icon topbar.
   The artwork/order is unchanged. This file fixes only authored geometry. */
:root{
  --zk-r181-btn:62px;
  --zk-r181-gap:7px;
  --zk-r181-nav-w:614px; /* 9*62 + 8*7 */
  --zk-r181-native:1269px; /* 286+140+136+93+614 */
}

/* Give the menu enough native room instead of squeezing nine controls into 503px. */
html body[data-ui-profile] .zk-v9-stage{
  grid-template-columns:286px 140px 136px 93px minmax(var(--zk-r181-nav-w),1fr)!important;
}
html body[data-ui-profile] .zk-v9-profile-cell{grid-column:1!important;grid-row:1!important}
html body[data-ui-profile] .zk-v9-zeni-cell{grid-column:2!important;grid-row:1!important}
html body[data-ui-profile] .zk-v9-premium-cell{grid-column:3!important;grid-row:1!important}
html body[data-ui-profile] .zk-v9-store-cell{grid-column:4!important;grid-row:1!important}
html body[data-ui-profile] .zk-v9-middle,
html body[data-ui-profile] .zk-v9-right-cell{
  grid-column:5!important;grid-row:1!important;min-width:0!important;width:auto!important;
}
html body[data-ui-profile] .zk-v9-middle{z-index:1!important;overflow:visible!important}
html body[data-ui-profile] .zk-v9-right-cell{z-index:3!important;overflow:visible!important}

/* Compact geometry must match the JS controller exactly. */
html body[data-ui-profile] .hunter-topbar.zk-v9-compact .zk-v9-stage{
  width:var(--zk-r181-native)!important;
  grid-template-columns:286px 140px 136px 93px var(--zk-r181-nav-w)!important;
}

/* Keep the right decorative cap at its natural authored width; do NOT stretch it. */
html body[data-ui-profile] .zk-v9-right-cell>.zk-v9-shell{
  left:auto!important;right:0!important;top:0!important;
  width:467px!important;height:105px!important;object-fit:fill!important;
}

/* Real 9-button navigation row. */
html body[data-ui-profile] .r178-top-icons{
  position:absolute!important;left:auto!important;right:16px!important;top:20px!important;bottom:auto!important;
  width:var(--zk-r181-nav-w)!important;height:var(--zk-r181-btn)!important;
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;
  gap:var(--zk-r181-gap)!important;padding:0!important;margin:0!important;overflow:visible!important;z-index:20!important;
}
html body[data-ui-profile] .r178-top-icons .top-btn,
html body[data-ui-profile] .r178-top-icons #optionsBtn{
  position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  flex:0 0 var(--zk-r181-btn)!important;width:var(--zk-r181-btn)!important;height:var(--zk-r181-btn)!important;
  min-width:var(--zk-r181-btn)!important;min-height:var(--zk-r181-btn)!important;
  display:block!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;
  background-color:transparent!important;background-repeat:no-repeat!important;background-position:center!important;
  background-size:62px 62px!important;box-shadow:none!important;filter:none!important;overflow:visible!important;
  pointer-events:auto!important;z-index:21!important;transition:transform .1s ease,filter .1s ease!important;
}

/* Same approved assets and exact approved order. */
html body[data-ui-profile] #huntsBtn{order:1!important;background-image:url('assets/ui/zenkai_topbar_r182/hunt.png')!important}
html body[data-ui-profile] #bestiaryBtn{order:2!important;background-image:url('assets/ui/zenkai_topbar_r182/cyclopedia.png')!important}
html body[data-ui-profile] #forgeTopBtn{order:3!important;background-image:url('assets/ui/zenkai_topbar_r182/forge.png')!important}
html body[data-ui-profile] #invBtn{order:4!important;background-image:url('assets/ui/zenkai_topbar_r182/bag.png')!important}
html body[data-ui-profile] #guildBtn{order:5!important;background-image:url('assets/ui/zenkai_topbar_r182/guild.png')!important}
html body[data-ui-profile] #guildRankBtn{order:6!important;background-image:url('assets/ui/zenkai_topbar_r182/ranking.png')!important}
html body[data-ui-profile] #recruitBtn{order:7!important;background-image:url('assets/ui/zenkai_topbar_r182/recruit.png')!important}
html body[data-ui-profile] #partyBtn{order:8!important;background-image:url('assets/ui/zenkai_topbar_r182/party.png')!important}
html body[data-ui-profile] #optionsBtn{order:9!important;background-image:url('assets/ui/zenkai_topbar_r182/options.png')!important}

html body[data-ui-profile] .r178-top-icons .top-btn:hover,
html body[data-ui-profile] .r178-top-icons .top-btn:focus-visible,
html body[data-ui-profile] .r178-top-icons #optionsBtn:hover,
html body[data-ui-profile] .r178-top-icons #optionsBtn:focus-visible{
  transform:translateY(-1px) scale(1.035)!important;filter:brightness(1.1) saturate(1.05)!important;
}
html body[data-ui-profile] .r178-top-icons .top-btn::before,
html body[data-ui-profile] .r178-top-icons #optionsBtn::before{content:''!important;display:none!important;background:none!important}
html body[data-ui-profile] #forgeTopBtn .forge-menu-icon,
html body[data-ui-profile] #guildBtn .r171-guild-icon,
html body[data-ui-profile] #guildRankBtn .r171-rank-icon{display:none!important}
html body[data-ui-profile] #equipmentBtn{display:none!important;pointer-events:none!important}
body.hunt-active #forgeTopBtn{display:none!important;pointer-events:none!important}

/* Server state sits above the icons instead of stealing their horizontal space. */
html body[data-ui-profile] .zk-v9-middle .server-strip{
  position:absolute!important;left:12px!important;top:4px!important;right:auto!important;bottom:auto!important;
  width:auto!important;max-width:310px!important;height:16px!important;min-height:16px!important;
  padding:0 5px!important;margin:0!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:5px!important;
  background:transparent!important;border:0!important;box-shadow:none!important;font-size:9px!important;line-height:16px!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;transform:none!important;z-index:5!important;
}

/* Kill every legacy positional offset on the nine current buttons. */
html body[data-ui-profile] #huntsBtn,
html body[data-ui-profile] #bestiaryBtn,
html body[data-ui-profile] #forgeTopBtn,
html body[data-ui-profile] #invBtn,
html body[data-ui-profile] #guildBtn,
html body[data-ui-profile] #guildRankBtn,
html body[data-ui-profile] #recruitBtn,
html body[data-ui-profile] #partyBtn,
html body[data-ui-profile] #optionsBtn{
  position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
}
