[data-simplebar] {
  position: relative;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  align-items: flex-start;
}

.simplebar-wrapper {
  overflow: hidden;
  width: inherit;
  height: inherit;
  max-width: inherit;
  max-height: inherit;
}

.simplebar-mask {
  direction: inherit;
  position: absolute;
  overflow: hidden;
  padding: 0;
  margin: 0;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  width: auto !important;
  height: auto !important;
  z-index: 0;
}

.simplebar-offset {
  direction: inherit !important;
  box-sizing: inherit !important;
  resize: none !important;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 0;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.simplebar-content-wrapper {
  direction: inherit;
  box-sizing: border-box !important;
  position: relative;
  display: block;
  height: 100%; /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */
  width: auto;
  visibility: visible;
  max-width: 100%; /* Not required for horizontal scroll to trigger */
  max-height: 100%; /* Needed for vertical scroll to trigger */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.simplebar-content-wrapper::-webkit-scrollbar,
.simplebar-hide-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.simplebar-content:before,
.simplebar-content:after {
  content: ' ';
  display: table;
}

.simplebar-placeholder {
  max-height: 100%;
  max-width: 100%;
  width: 100%;
  pointer-events: none;
}

.simplebar-height-auto-observer-wrapper {
  box-sizing: inherit !important;
  height: 100%;
  width: 100%;
  max-width: 1px;
  position: relative;
  float: left;
  max-height: 1px;
  overflow: hidden;
  z-index: -1;
  padding: 0;
  margin: 0;
  pointer-events: none;
  flex-grow: inherit;
  flex-shrink: 0;
  flex-basis: 0;
}

.simplebar-height-auto-observer {
  box-sizing: inherit;
  display: block;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 1000%;
  width: 1000%;
  min-height: 1px;
  min-width: 1px;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.simplebar-track {
  z-index: 1;
  position: absolute;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

[data-simplebar].simplebar-dragging .simplebar-content {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

[data-simplebar].simplebar-dragging .simplebar-track {
  pointer-events: all;
}

.simplebar-scrollbar {
  position: absolute;
  left: 0;
  right: 0;
  min-height: 10px;
}

.simplebar-scrollbar:before {
  position: absolute;
  content: '';
  background: black;
  border-radius: 7px;
  left: 2px;
  right: 2px;
  opacity: 0;
  transition: opacity 0.2s linear;
}

.simplebar-scrollbar.simplebar-visible:before {
  /* When hovered, remove all transitions from drag handle */
  opacity: 0.5;
  transition: opacity 0s linear;
}

.simplebar-track.simplebar-vertical {
  top: 0;
  width: 11px;
}

.simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
  top: 2px;
  bottom: 2px;
}

.simplebar-track.simplebar-horizontal {
  left: 0;
  height: 11px;
}

.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before {
  height: 100%;
  left: 2px;
  right: 2px;
}

.simplebar-track.simplebar-horizontal .simplebar-scrollbar {
  right: auto;
  left: 0;
  top: 2px;
  height: 7px;
  min-height: 0;
  min-width: 10px;
  width: auto;
}

/* Rtl support */
[data-simplebar-direction='rtl'] .simplebar-track.simplebar-vertical {
  right: auto;
  left: 0;
}

.hs-dummy-scrollbar-size {
  direction: rtl;
  position: fixed;
  opacity: 0;
  visibility: hidden;
  height: 500px;
  width: 500px;
  overflow-y: hidden;
  overflow-x: scroll;
}

.simplebar-hide-scrollbar {
  position: fixed;
  left: 0;
  visibility: hidden;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* --- SimpleBar 挙動修正--- */

/* ========================================================== */
/* A. テーブル表示の修正 (ナビゲーション以外の全 SimpleBar に適用) */
/* ========================================================== */

/* 0. 【テーブル用】ラッパーのネガティブマージンをリセットし、不要な縦スクロールを防止 */
/* ナビゲーション (#head_nav_dropdown) 内の要素は除外 */
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-wrapper {
    margin: 0 !important; 
}

/* 1. 【テーブル用：高さ/位置修正】SimpleBarの主要ラッパーの高さ制限と絶対配置を解除 */
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *), 
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-wrapper,
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-mask,
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-offset,
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-content-wrapper {
    /* 縦方向の制御を解除 */
    height: auto !important;
    max-height: none !important;
    
    /* 飛び出し防止のため、絶対配置を解除 */
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
}

/* 2. 【テーブル用：スクロール制御】コンテンツラッパーの縦スクロールを無効化し、横スクロールを維持 */
/* .simplebar-content-wrapper はグローバルクラスのため、ナビゲーション内は除外 */
.simplebar-content-wrapper:not(#head_nav_dropdown .simplebar-content-wrapper) {
    /* 縦スクロールを visible にして見切れを解消 */
    overflow-y: visible !important; 
    /* 横スクロールは auto にして、スマホ表示で必要なら出るように維持 */
    overflow-x: auto !important; 
    
    /* 横方向のはみ出し吸収と幅の調整 */
    width: 100% !important; 
    box-sizing: border-box !important;
}

/* 3. 【テーブル用：横方向の吸収】ルート要素とマスクでわずかなはみ出しを隠す */
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) {
    overflow-x: hidden !important;
}
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-mask {
    width: 100% !important;
}

/* 4. 【テーブル用：クリーンアップ】カスタムスクロールバー、プレースホルダー、パディングを非表示/リセット */
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-track,
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-placeholder {
    display: none !important;
    height: 0 !important;
}
.scroll_box[data-simplebar="init"]:not(#head_nav_dropdown *) .simplebar-offset {
    padding: 0 !important;
}


/* ========================================================== */
/* B. グローバルナビゲーションの修復 (ユーザー指定のルールを適用) */
/* ========================================================== */

/* 1. 【高さと位置の修復】ナビゲーションのドロップダウンメニューに position/height を再強制 */
/* ナビのドロップダウンの各階層をターゲットにします */
#head_nav_dropdown .first .scroll_box[data-simplebar],
#head_nav_dropdown .second .scroll_box[data-simplebar],
#head_nav_dropdown .third .scroll_box[data-simplebar],
#head_nav_dropdown .first .simplebar-mask,
#head_nav_dropdown .second .simplebar-mask,
#head_nav_dropdown .third .simplebar-mask {
    /* テーブル修正の static を打ち消し、ナビが必要とする position に戻す */
    position: relative !important; 
    
    /* height: auto を打ち消し、ナビの高さ（背景）を確保 */
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    
    /* 飛び出し防止の top/bottom/left/right も元に戻す */
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. 【縦スクロールの修復】ナビゲーション内の縦スクロールを有効に戻す */
#head_nav_dropdown .first .simplebar-content-wrapper,
#head_nav_dropdown .second .simplebar-content-wrapper,
#head_nav_dropdown .third .simplebar-content-wrapper {
    /* テーブル修正の overflow-y: visible を打ち消し、スクロールを有効に戻す */
    overflow-y: scroll !important; 
}

/* 3. 【縦スクロールバー修復】ナビゲーションのカスタムスクロールバーを再表示 */
#head_nav_dropdown .simplebar-track.simplebar-vertical {
    display: block !important;
    visibility: visible !important;
}

/* 4. 【あしらい（＞など）の修正】ナビゲーション内の要素が正しく表示されるように position を調整 */
#head_nav_dropdown .nav_arrow {
    /* ナビの矢印が float や position に依存している可能性があるため、関連要素の position を確認 */
    position: relative !important; 
}