/* 補助金.com 自動フローティング目次スタイル
   2026-05-25 RL351
   - デスクトップ(≥1100px): 右側固定フローティング
   - モバイル(<1100px): 上部固定 collapsible
*/
#hj-toc {
  font: 13px/1.6 system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  z-index: 99;
  box-sizing: border-box;
}
#hj-toc .hj-toc-tgl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a5490;
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(31,77,140,.25);
  font-family: inherit;
}
#hj-toc .hj-toc-tgl .hj-toc-cv {
  font-size: 10px;
  transition: transform .2s;
}
#hj-toc.open .hj-toc-tgl .hj-toc-cv {
  transform: rotate(180deg);
}
#hj-toc .hj-toc-list {
  display: none;
  list-style: none;
  margin: 8px 0 0;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  max-height: 60vh;
  overflow-y: auto;
}
#hj-toc.open .hj-toc-list { display: block; }
#hj-toc .hj-toc-list li {
  margin: 0;
  padding: 2px 0;
  line-height: 1.5;
}
#hj-toc .hj-toc-l3 { padding-left: 16px; font-size: 12px; }
#hj-toc .hj-toc-list a {
  display: block;
  padding: 4px 8px;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  border-left: 3px solid transparent;
}
#hj-toc .hj-toc-list a:hover {
  background: #f0f4f8;
  color: #1a5490;
}
#hj-toc .hj-toc-list a.active {
  background: #e8f0fb;
  color: #1a5490;
  border-left-color: #1a5490;
  font-weight: 700;
}

/* デスクトップ: 右側固定フローティング */
@media (min-width: 1100px) {
  #hj-toc {
    position: fixed;
    top: 110px;
    right: 16px;
    width: 260px;
    max-height: calc(100vh - 140px);
  }
  #hj-toc .hj-toc-tgl { width: 100%; justify-content: space-between; }
  #hj-toc .hj-toc-list {
    max-height: calc(100vh - 220px);
  }
}

/* モバイル: 上部固定アコーディオン */
@media (max-width: 1099px) {
  #hj-toc {
    position: sticky;
    top: 8px;
    margin: 0 0 16px;
    background: transparent;
  }
}

@media print {
  #hj-toc { display: none !important; }
}
