.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #ddd;
  gap: 12px;
  background: #fff;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* .brand {
  font-weight: 700;
} */

.nav a {
  margin-right: 10px;
  text-decoration: none;
  color: #333;
}

.nav a.active {
  font-weight: 700;
  text-decoration: underline;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scope a {
  margin-right: 8px;
  text-decoration: none;
  color: #333;
}

.scope a.active {
  font-weight: 700;
  text-decoration: underline;
}

.year-select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

.search-wrap {
  position: relative;
}

.search {
  width: 260px;
  padding: 6px 32px 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  line-height: 20px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  cursor: pointer;
}

.search-clear:hover {
  background: #f6f6f6;
}

.search-clear:hover {
  border-color: #bbb;
}


.issues-page {
  /* height: 100vh; */
  display: flex;
  flex-direction: column;
}

.layout {
  display: grid;
  /* 右カラムが 0px まで潰れて横スクロールが発生しないようにする */
  grid-template-columns: 360px minmax(0, 1fr);
  height: calc(100vh - 52px);
  overflow: hidden;
  align-items: stretch;
}

/* right が 0px に潰れるのを防ぐ */
.right,
.detail-layout,
.detail-main {
  min-width: 0;
}

.left {

  width: 360px;
  border-right: 1px solid #ddd;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.left-header {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-weight: 700;
}

.list {
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-item {
  text-align: left;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}

.list-item:hover {
  border-color: #cfcfcf;
  background: #fafafa;
}

.list-item.selected {
  border-color: #6b6b6b;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
}

.left-footer {
  margin: 30px;
}

.li-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.li-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.li-code {
  color: #666;
  flex: 0 0 auto;
}

.li-sub,
.li-sub2 {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #f6f6f6;
}

.muted {
  color: #666;
  font-size: 12px;
}

.right {
  height: 100%;
  overflow-x: hidden;
  padding-right: 12px;
  min-width: 0;
}

.right-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
}

.back-btn {
  display: none;
  /* モバイル時のみ表示 */
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.back-btn:hover {
  background: #f6f6f6;
}

.detail-title {
  font-size: 18px;
  font-weight: 800;
}

.detail-lead {
  margin-top: 6px;
  color: #666;
}

.detail-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.card-title {
  font-weight: 800;
  margin-bottom: 10px;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 12px;
  align-items: baseline;
}

.k {
  color: #666;
  font-size: 12px;
}

.v {
  color: #222;
}

.text {
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ===== 幹事団テーブル（整理後・完成形） ===== */

.syndicate {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

/* .syndicate th, */
.syndicate td {
  border-bottom: 1px solid #eee;
  padding: 6px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ヘッダ */
.syndicate th {
  background: #fafafa;
  color: #666;
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* 列ごとの表示制御（colgroup 前提） */
.syndicate td:nth-child(2),
.syndicate th:nth-child(2),
.syndicate td:nth-child(3),
.syndicate th:nth-child(3) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 主幹事強調 */
.syndicate tr.lead td {
  font-weight: 700;
  color: #b00000;
}

/* グループ見出し（抽選時資金の要否・期待度対象で区切る） */
.syndicate tr.syndicate-group td {
  background: #fefceb;
  color: #555;
  font-weight: 700;
  font-size: 12px;
  border-top: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
  padding: 8px 8px;
}

.syndicate .syndicate-empty {
  margin-left: 8px;
  font-weight: 400;
  color: #888;
}

.syndicate .syndicate-empty-row {
  text-align: center !important;
  color: #888;
  padding: 16px 8px;
}

/* グループ見出しの後は余白感を出す（視認性優先） */
.syndicate tr.syndicate-group + tr td {
  padding-top: 8px;
}

.syndicate col.col-firm {
  width: 55%;
}

.syndicate col.col-shares-only {
  width: 45%;
}

.syndicate-score col.col-firm {
  width: 34%;
}

.syndicate-score col.col-score-ratio {
  width: 42%;
}

.syndicate-score col.col-score {
  width: 24%;
}

.lead-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid #f2c2c2;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  color: #b00000;
  background: #fff6f6;
  vertical-align: middle;
  white-space: nowrap;
}

.syndicate-note {
  margin-top: 8px;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}


/* ===== 詳細ペイン内：広告対応レイアウト ===== */
.detail-layout {
  height: 100%;
  display: flex;
  gap: 24px;
  align-items: stretch;
  min-height: 0;
}

/* 左：情報（読みやすさ優先） */
.detail-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* 端でスクロールが止まったら Window 側に渡す（既定挙動を阻害しない） */
  overscroll-behavior: auto;
}

/* 右：説明/広告 */
.detail-side {
  width: 300px;
  flex-shrink: 0;
  min-height: 0;
  display: flex;
  border-left: 1px solid #ddd;
  padding-left: 16px;
  overflow-y: auto;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.detail-side .side-stack {
  width: 100%;
}


.issues-help h3 {
  margin: 0 0 8px 0;
  padding: 6px;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
}

.issues-help details {
  margin-top: 8px;
}

.issues-help summary {
  cursor: pointer;
  font-weight: 600;
}

.issues-help .help-body p {
  margin: 8px 0;
}

.issues-help .help-body ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

/* 説明欄のラッパ（配置場所ごとの表示制御をするため） */
.issues-help-wrap {
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

/* 一覧/詳細の末尾に置いたときの間隔 */
.list .issues-help-wrap,
.detail-body .issues-help-wrap {
  margin-top: 12px;
}

/* デスクトップでは右ペイン側のみ表示 */
.issues-help-wrap--mobile {
  display: none;
}

/* ===== レスポンシブ ===== */
/* 狭くなったら縦積み */
@media (max-width: 1024px) {

  /* モバイルでは下部（一覧/詳細とも）に表示 */
  .issues-help-wrap--mobile {
    display: block;
  }

  .issues-help-wrap--desktop {
    display: none;
  }

  .detail-layout {
    flex-direction: column;
    gap: 12px;
  }

  .detail-side {
    display: none;
  }

  .layout {
    display: flex;
    flex-direction: column;
  }

  .left {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    max-width: 100%;
    overflow-x: hidden;
    flex-wrap: wrap;
  }

  .right {
    display: none;
  }


  .issues-page.show-detail .layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 56px);
    /* ← common header 高さ */
    overflow: hidden;
    /* ★ここだけ */
  }

  /* モバイル: 一覧→詳細を切り替える（横スクロールさせない） */
  .issues-page.show-detail .left {
    display: none;
  }

  .issues-page.show-detail .right {
    display: block;
    padding-right: 0;
  }

  .issues-page.show-detail .back-btn {
    display: inline-flex;
  }

  .search {
    width: 100%;
    max-width: 100%;
  }

  .topbar-right {
    width: 100%;
  }
}

/* ===== 広告スタック ===== */
.ad-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;

}

/* 300x250 枠 */
.ad-300x250 {
  width: 300px;
  height: 250px;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: 8px;
}

/* 中央寄せ（右ペイン内） */
.detail-side .ad-stack {
  align-items: center;
}

/* 全体の色調整 */

body {
  background: #f7f8fa;
}

.left {
  background: #f3f4f6;
}

.left-header {
  background: #eef0f3;
}

.card {
  background: #ffffff;
  border: 1px solid #e6e8ec;
}

.list-item.selected {
  background: #fff7ee;
  /* background: #eef7ff;   */
  border-color: #6b6b6b;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e6e8ec;
}

.detail-side .ad-300x250 {
  background: #fafafa;
  border: 1px dashed #ddd;
}

.bb_start,
.bb_end {
  color: rgba(70, 130, 180, 0.9);
  font-weight: 600;
}

.lottery_date {
  font-weight: 800;
  color: rgba(255, 140, 0, 0.8);
}

.apply_start,
.apply_end {
  color: rgba(34, 139, 34, 0.9);
  font-weight: 600;
}

.listing_date {
  color: rgba(220, 20, 60, 0.8);
  font-weight: 600;
} */

/* default row spacing */
/* .kv .k,
.kv .v {
  padding-top: 2px;
  padding-bottom: 2px;
}

/* space before key phase changes */
.kv .lottery_date,
.kv .apply_start,
.kv .listing_date {
  margin-top: 12px;
}

.kome {
  font-size: 11px;
}


.syndicate td,
.syndicate th {
  vertical-align: middle;
}

.col-allocation,
.col-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
}