#headerSub-flex{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;  /* 右側は必要分だけ */
}
#headerSub .searchBox{
    position: relative;
    display: flex;
    align-items: center;
}
#search_box{
    width: 270px;
    height: 40px;              /* 少し余裕（好みで） */
    padding: 5px 44px 5px 10px;/* ★右paddingを増やす */
    border: 0;
    border-radius: 5px;
    box-sizing: border-box;
}
#search_button{
    position: absolute;        /* ★ここで重ねる */
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    cursor: pointer;
}
/* 追加（ヘッダー右上UI用。既存CSSに追記でもOK）  */
/* header_sub の見た目は既存に合わせて微調整してOK */
#header_sub{
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
/* ★ここが肝：ログイン/ログアウト問わず「各liを同じ高さ」にする */
#header_sub > li{
    display: flex;
    align-items: center;
    height: 40px;          /* ←ログイン時(ユーザー40px)に揃える */
}
#header_sub > li:last-child{
    margin-right: 0;
}
/* ログアウト時の a（ログイン/新規登録）も 40px に揃える */
#header_sub > li > a{
    display: inline-flex;
    align-items: center;
    height: 40px;
    line-height: 40px;     /* テキストの上下ズレ防止 */
    padding: 0 12px;       /* 横だけ余白（お好みで） */
    box-sizing: border-box;
    text-decoration: none;
}
/* ベル（通知） */
.header-icon-link{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 999px;
    text-decoration: none;
}
.header-icon-link svg{
  width: 34px;     /* 40 → 34 に縮小 */
  height: 34px;
  display:block;   /* 余白を消す（重要） */
}
/* ユーザーメニュー */
.userMenu{
    position: relative;
    display: inline-flex;
    align-items: center;
}
.userMenu__btn{
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: transparent; /* ★ここを変更 */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 0;        /* ★ボタン由来の微妙な行高ズレを殺す */
}
.userMenu__btn svg{
    width: 22px;
    height: 22px;
}
.userMenu__icon_img{
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.userMenu__panel{
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    padding: 10px;
    z-index: 9999;
    display: none;
}
.userMenu__panel.is-open{
    display: block;
}
.userMenu__email{
    font-size: 12px;
    color: rgba(0,0,0,.7);
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    margin-bottom: 8px;
    word-break: break-all;
}
.userMenu__list{
    list-style: none;
    padding: 0;
    margin: 0;
}
.userMenu__list a{
    display: block;
    margin: 5px 0;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}
.userMenu__list li:nth-child(3n+1){
    border-bottom: #ccc 1px solid;
}
.userMenu__list a:hover{
    background: rgba(0,0,0,.05);
}

#login,
#register{
    padding: 0 1vw 0 0;  /* ★ 横だけ */
}
#login a:link{
    color: black;
    font-weight: bold;
}
#login a:visited{
    color: black;
    font-weight: bold;
}
#login a:hover{
    color: black;
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 8px;
}
#register a{
    padding: 0.9vh 0.8vw 0.9vh 0.8vw;
    border-radius: 10px;
}
#register a:link{
    color: green;
    background-color: white;
    font-weight: bold;
}
#register a:visited{
    color: green;
    background-color: white;
    font-weight: bold;
}
#register a:hover{
    color: white;
    font-weight: bold;
    background-color: green;
}
/* ヘッダーのベル用バッジ */
.header-icon-link.has-badge{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
/* SVGを包む */
.header-icon-wrap{
  position: relative;
  display: flex;          /* inline-block → flex に変更 */
  align-items: center;
  justify-content: center;
  line-height: 0;         /* baselineズレ防止 */
}

/* バッジをSVG基準にする */
.header-notify-badge{
  position:absolute;

  top:4px;     /* ←マイナスをやめる */
  right:4px;   /* ←内側に寄せる */

  width:15px;
  height:15px;
  border-radius:50%;

  display:flex;
  align-items:center;
  justify-content:center;

  background:#ff3b30;
  color:#fff;
  font-size:10px;
  font-weight:900;
}
header,
#top-gNavi,
#headerSub-flex,
#header_sub,
#register,
.userMenu {
  overflow: visible !important;
}

.userMenu {
  position: relative;
}

.userMenu__panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 99999;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.userMenu__panel.is-open {
  display: block !important;
}