/* Phase J1 (rev2): カードクイズ画面（純サーバーレンダ）専用スタイル
   /{lang}/quiz/boosters/{setId}/{cardNo}
   - 配色: 背景#f4f6fa / ヘッダ#ffffff / カード#ffffff / アクセント#1d4ed8
   - フォント: M PLUS 1p / Hiragino

   Phase J10: タグ + 類似裁定セクション追加
*/

/* === Phase J10: タグ表示 === */
.cq-qa-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 14px 0 0;
}
.cq-qa-tag {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: background 0.15s, transform 0.1s;
}
.cq-qa-tag:hover {
  background: #bfdbfe;
}
.cq-qa-tag:active {
  transform: scale(0.97);
}

/* === Phase J10: 類似裁定セクション === */
.cq-qa-similar {
  margin: 12px 0 0;
  border: 1px solid #d5dae5;
  border-radius: 8px;
  background: #ffffff;
}
.cq-qa-similar > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.04em;
}
.cq-qa-similar > summary::-webkit-details-marker { display: none; }
.cq-qa-similar > summary::before {
  content: '▶';
  display: inline-block;
  font-size: 9px;
  margin-right: 6px;
  transition: transform 0.15s;
}
.cq-qa-similar[open] > summary::before { transform: rotate(90deg); }
.cq-qa-similar > summary:hover { background: #eff6ff; }

.cq-qa-similar-list {
  display: flex;
  flex-direction: column;
  border-top: 1px dashed #d5dae5;
}
.cq-qa-similar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px dashed #eef1f6;
  color: inherit;
  transition: background 0.15s;
}
.cq-qa-similar-item:last-child { border-bottom: none; }
.cq-qa-similar-item:hover { background: #f4f6fa; }
.cq-qa-similar-card {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 70px;
  text-align: center;
  letter-spacing: 0.03em;
}
.cq-qa-similar-q {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.6;
  color: #171f55;
  word-break: break-word;
}

/* ===== Phase J11+: 論点クラスタ表示 ===== */
.cq-qa-similar-clusters {
  border-top: 1px dashed #d5dae5;
  background: #fafbfd;
}
.cq-similar-cluster {
  border-bottom: 1px solid #eef1f6;
}
.cq-similar-cluster:last-child { border-bottom: none; }

.cq-similar-cluster-head {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  transition: background 0.15s;
}
.cq-similar-cluster-head::-webkit-details-marker { display: none; }
.cq-similar-cluster-head::before {
  content: '▶';
  display: inline-block;
  font-size: 9px;
  color: #9ca3af;
  transition: transform 0.15s;
  margin-right: 2px;
}
.cq-similar-cluster[open] > .cq-similar-cluster-head::before {
  transform: rotate(90deg);
}
.cq-similar-cluster-head:hover { background: #eff6ff; }

.cq-similar-topic-icon { font-size: 13px; }
.cq-similar-topic-label {
  flex: 1;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.02em;
}
.cq-similar-topic-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 10px;
}

.cq-similar-cluster-body {
  padding: 8px 14px 14px 30px;
  background: #fafbfd;
}

.cq-similar-answer-group {
  margin-top: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border-left: 3px solid #1d4ed8;
  border-radius: 4px;
}
.cq-similar-answer-group:first-child { margin-top: 0; }
.cq-similar-answer-preview {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 6px;
  line-height: 1.55;
}
.cq-similar-group-count {
  font-size: 11px;
  font-weight: 700;
  color: #4338ca;
  margin-left: 2px;
}

.cq-similar-more {
  margin-top: 6px;
}
.cq-similar-more > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #4338ca;
  text-align: center;
  background: #eef2ff;
  border-radius: 4px;
  border: 1px dashed #c7d2fe;
  transition: background 0.12s;
}
.cq-similar-more > summary::-webkit-details-marker { display: none; }
.cq-similar-more > summary::before {
  content: '▼ ';
  font-size: 9px;
  margin-right: 4px;
  transition: transform 0.15s;
  display: inline-block;
}
.cq-similar-more[open] > summary::before {
  transform: rotate(180deg);
}
.cq-similar-more > summary:hover { background: #e0e7ff; }
.cq-similar-more > ul.cq-similar-items {
  margin-top: 4px;
}

.cq-similar-singletons {
  margin-top: 12px;
}
.cq-similar-singletons-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.cq-similar-items {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cq-similar-items li { margin: 0; }
.cq-similar-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  transition: background 0.12s;
}
.cq-similar-link:hover { background: #eef2ff; }

.cq-similar-card {
  flex-shrink: 1;          /* 必要に応じて縮小可（モバイルで chip が暴れない） */
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 60px;
  max-width: 45%;          /* 半分以上は占めない */
  text-align: center;
  letter-spacing: 0.03em;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cq-similar-thumb {
  flex-shrink: 0;
  width: 32px;
  height: 45px;
  object-fit: cover;
  border-radius: 3px;
  background: #f4f6fa;
  border: 1px solid #d5dae5;
}
.cq-similar-q {
  flex: 1;
  min-width: 0;            /* flex item の min-width:auto を上書き、これがないと縮小不可 */
  font-size: 12.5px;
  line-height: 1.55;
  color: #171f55;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* モバイル（375px 以下）では link 内を 2 行に積む（サムネイル+chip / 質問 で改行） */
@media (max-width: 480px) {
  .cq-similar-link {
    flex-wrap: wrap;
    align-items: center;
  }
  .cq-similar-card {
    max-width: calc(100% - 48px); /* サムネ+gap 分を引いた残り */
  }
  .cq-similar-q {
    flex-basis: 100%;
    margin-top: 2px;
    padding-left: 40px;     /* サムネ幅+gap 分インデント */
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.cq-body {
  background: #f4f6fa;
  color: #171f55;
  font-family: 'M PLUS 1p', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Apple SD Gothic Neo', 'PingFang SC', sans-serif;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

.cq-page {
  width: 100%;
  max-width: 500px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 0 100px;
}

/* ===== ヘッダー（サイトタイトル・スティッキー）===== */
.cq-header {
  background: #ffffff;
  border-bottom: 1px solid #eef1f6;
  padding: 14px 20px 12px;
  text-align: center;
}

/* Phase J11.1: 日付モードのバナー（ヘッダー直下） */
.cq-date-banner {
  margin: 10px -20px -12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #171f55 0%, #1d4ed8 100%);
  color: #fafbfd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
}
.cq-site-title {
  font-size: 15px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: block;
  padding-bottom: 6px;
}
.cq-back {
  display: inline-block;
  font-size: 11px;
  color: #7a829a;
  text-decoration: none;
  padding: 2px 0;
}
.cq-back:hover { color: #1d4ed8; }

/* ===== カード番号タイトル（前後ナビ含むサブヘッダ）===== */
.cq-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 16px 0;
}
.cq-subhead-center {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #7a829a;
  letter-spacing: 0.03em;
}
.cq-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 10px;
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #d5dae5;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}
.cq-nav-btn:hover { background: #eef1f6; }
.cq-nav-btn.disabled {
  visibility: hidden;
}

/* ===== カード画像 ===== */
.cq-card-img-wrap {
  padding: 16px 8px 0;
  display: flex;
  justify-content: center;
}
.cq-card-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: 10px;
  border: 1px solid #c5cbdc;
  background: #ffffff;
  display: block;
}

/* ===== カードラベル＋設問ブロック ===== */
.cq-q-block {
  padding: 20px 20px 0;
}
.cq-card-label {
  display: inline-block;
  background: #ffffff;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: #1d4ed8;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

/* ===== Q&A セクション ===== */
.cq-qas-title {
  font-size: 13px;
  font-weight: 700;
  color: #7a829a;
  letter-spacing: 0.05em;
  padding: 24px 20px 0;
  margin-bottom: -4px;
}
.cq-qa {
  padding: 20px 20px 0;
  scroll-margin-top: 60px;
}
.cq-qa-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cq-qa-no {
  background: #1d4ed8;
  color: #fafbfd;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.05em;
}
.cq-qa-id {
  color: #9aa1b3;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cq-qa-question {
  font-size: 15px;
  line-height: 1.75;
  color: #171f55;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}
/* ===== 公式から削除された旧裁定の注意書き =====
   `@deprecated:official-removed` タグ付き Q&A に表示。
   薄いオレンジで「資料として保持」を視覚的に示す */
.cq-qa-deprecated {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 12px;
  padding: 8px 12px;
  background: #fff7ed;
  border-left: 3px solid #fb923c;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: #7a5430;
}
.cq-qa-deprecated-icon {
  font-size: 14px;
  color: #fb923c;
  flex-shrink: 0;
  line-height: 1.4;
}

/* ===== 裁定を見る（reveal）ボタン ===== */
.cq-qa-answer {
  margin: 16px 0 0;
}
.cq-qa-answer summary {
  display: block;
  width: 100%;
  background: #1d4ed8;
  border: none;
  border-radius: 12px;
  color: #fafbfd;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  list-style: none;
  user-select: none;
  letter-spacing: 0.03em;
}
.cq-qa-answer summary::-webkit-details-marker { display: none; }
.cq-qa-answer summary:active { opacity: 0.8; }
.cq-qa-answer[open] summary {
  background: #ffffff;
  color: #7a829a;
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  border: 1px solid #d5dae5;
}

/* ===== 公式裁定（answer 本文）===== */
.cq-qa-answer-body {
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid #d5dae5;
  border-radius: 10px;
  padding: 16px;
}
.cq-qa-answer-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}
.cq-qa-answer-text {
  font-size: 14px;
  line-height: 1.85;
  color: #171f55;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 公式裁定ページへのディープリンク（POST フォーム経由）
   裁定本文の末尾に表示し、クリックで公式の該当 Q&A 検索結果に飛ばす */
.cq-qa-official-link {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  background: #f4f6fa;
  color: #1d4ed8;
  border: 1px solid #c5cbdc;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
  transition: background-color 0.15s ease;
}
.cq-qa-official-link:hover {
  background: #e8edf5;
  text-decoration: none;
}
.cq-qa-official-link:active { opacity: 0.8; }

/* ===== 次のカードへ進むボタン（Q&A ごと）=====
   Phase J4 (検索ページ) 完成後は、検索コンテキストがある場合に
   JS でこの a 要素の href を「次の検索結果」へ書き換える予定
*/
.cq-qa-next {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px 12px;
  background: #ffffff;
  border: 1px solid #1d4ed8;
  border-radius: 10px;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.05em;
}
.cq-qa-next:hover {
  background: #1d4ed8;
  color: #fafbfd;
}
.cq-qa-next:active { opacity: 0.85; }

/* スキップボタン（Q&A 無し時に「次の Q&A ありカードへ ⏭」を表示） */
.cq-qa-skip {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  background: #eef2ff;
  border: 1px dashed #c7d2fe;
  border-radius: 8px;
  color: #4338ca;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.04em;
}
.cq-qa-skip:hover { background: #e0e7ff; color: #312e81; }
.cq-qa-skip:active { opacity: 0.85; }

/* ===== Q&A アクション（ブックマーク／URL コピー）===== */
.cq-qa-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.cq-qa-next + .cq-qa-actions {
  margin-top: 8px;
}

/* === 「裁定を見る」を開くまで、操作ボタン群を非表示にする ===
   <details class="cq-qa-answer"> が [open] になったときだけ、
   兄弟要素の .cq-qa-next（次のカード）と .cq-qa-actions（ブックマーク・URLコピー）を表示する。
   兄弟結合子 ~ は「同じ親の中の後続兄弟要素」にマッチする。
*/
.cq-qa-next,
.cq-qa-actions {
  display: none;
}
.cq-qa-answer[open] ~ .cq-qa-next {
  display: block;
}
.cq-qa-answer[open] ~ .cq-qa-actions {
  display: flex;
}
/* Q&A 無しの「裁定がまだ登録されていません」表示時は、隣の「次へ」も表示する */
.cq-empty ~ .cq-qa-next {
  display: block;
}
.cq-qa-actions button {
  flex: 1;
  padding: 10px;
  background: #ffffff;
  color: #171f55;
  border: 1px solid #d5dae5;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cq-qa-actions button:hover { background: #eef1f6; }
.cq-bookmark-btn.on {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #1d4ed8;
}

/* ===== 言及カード（質問/回答が他カードを引用しているとき）
       本体のカード画像と同じ大きさ・スタイルで縦に並べる ===== */
.cq-qa-mentioned {
  margin: 16px 0 0;
}
.cq-qa-mentioned-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cq-qa-mentioned-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.cq-qa-mentioned-card img {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid #c5cbdc;
  background: #ffffff;
}
.cq-qa-mentioned-card:hover img { border-color: #1d4ed8; }
.cq-qa-mentioned-no {
  display: inline-block;
  margin: 8px auto 0;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  font-size: 11px;
  color: #1d4ed8;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}
.cq-qa-mentioned-card { text-align: center; }

.cq-empty {
  margin: 20px;
  background: #ffffff;
  border: 1px dashed #c5cbdc;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: #9aa1b3;
  font-size: 13px;
}

/* ===== 同弾の他カード ===== */
.cq-related {
  padding: 28px 20px 0;
}
.cq-related-title {
  font-size: 13px;
  font-weight: 700;
  color: #7a829a;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.cq-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 480px) {
  .cq-related-grid { grid-template-columns: repeat(4, 1fr); }
}
.cq-related-card {
  display: block;
  background: #ffffff;
  border: 1px solid #d5dae5;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.cq-related-card:hover { border-color: #1d4ed8; }
.cq-related-card img {
  width: 100%;
  display: block;
  background: #ffffff;
}
.cq-related-no {
  padding: 5px 6px;
  font-size: 10px;
  color: #1d4ed8;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ===== クイックナビ ===== */
.cq-quick-nav {
  display: flex;
  gap: 8px;
  padding: 24px 20px 0;
}
.cq-quick-nav a {
  flex: 1;
  padding: 12px 10px;
  background: #ffffff;
  border: 1px solid #d5dae5;
  border-radius: 10px;
  color: #171f55;
  text-decoration: none;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}
.cq-quick-nav a:hover {
  background: #eef1f6;
  color: #171f55;
}

/* ===== フッター ===== */
.cq-footer {
  margin-top: 32px;
  padding: 18px 20px 0;
  border-top: 1px solid #eef1f6;
  text-align: center;
  font-size: 11px;
  color: #9aa1b3;
  line-height: 2.0;
}
.cq-footer a {
  color: #1d4ed8;
  text-decoration: none;
  margin: 0 4px;
}
.cq-footer a:hover { text-decoration: underline; }
.cq-footer .sep { color: #c5cbdc; margin: 0 4px; }

/* ===== トースト ===== */
.cq-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(40, 40, 40, 0.95);
  color: #171f55;
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 9999;
}
.cq-toast.show { opacity: 1; }

/* ===== キーワードポップアップ（ボトムシート） =====
   keyword-popup.js が #kw-overlay / #kw-popup を生成する前提のスタイル。 */
#kw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
}
#kw-overlay.show { display: block; }

#kw-popup {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-top: 1px solid #d5dae5;
  border-radius: 16px 16px 0 0;
  padding: 20px 20px 44px;
  z-index: 301;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
  transform: translateX(-50%) translateY(100%);
  transition: transform 0.25s ease;
}
#kw-popup.show { transform: translateX(-50%) translateY(0); }

.kw-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.kw-popup-name {
  font-size: 18px;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1.3;
}
.kw-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  background: #eef2ff;
  color: #4338ca;
}
.kw-type-badge.常在型,
.kw-type-badge.常在 { background: #dbeafe; color: #1d4ed8; }
.kw-type-badge.誘発型,
.kw-type-badge.誘発 { background: #dcfce7; color: #15803d; }
.kw-type-badge.即時型,
.kw-type-badge.即時 { background: #fef3c7; color: #b45309; }
.kw-type-badge.起動型,
.kw-type-badge.起動 { background: #fde2e7; color: #b91c1c; }
.kw-type-badge.処理型,
.kw-type-badge.処理 { background: #ede9fe; color: #6d28d9; }
.kw-type-badge.特殊進化 { background: #fae8ff; color: #a21caf; }

/* バッジに total-rule 情報が紐づくときだけクリック可能にする */
.kw-type-badge {
  border: 0;
  cursor: default;
  font-family: inherit;
}
.kw-type-badge.clickable {
  cursor: pointer;
}
.kw-type-badge.clickable::after {
  content: ' ▼';
  font-size: 8px;
  margin-left: 2px;
}
.kw-type-badge.clickable.open::after {
  content: ' ▲';
}

.kw-type-rule-wrap {
  display: none;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.kw-type-rule-wrap.show { display: block; }
.kw-type-rule-section {
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.kw-type-rule-text {
  font-size: 12px;
  color: #3a4253;
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.kw-popup-close {
  margin-left: auto;
  background: #ffffff;
  border: 1px solid #c5cbdc;
  border-radius: 50%;
  color: #7a829a;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  padding: 0;
}
.kw-popup-close:active { background: #eef1f6; }

.kw-popup-short {
  font-size: 15px;
  font-weight: 700;
  color: #171f55;
  margin-bottom: 14px;
  line-height: 1.6;
}

.kw-popup-detail {
  font-size: 13px;
  color: #3a4253;
  line-height: 1.85;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #f4f6fa;
  border-left: 3px solid #1d4ed8;
  border-radius: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.kw-popup-caution {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.kw-popup-caution-label {
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.kw-popup-caution-body {
  font-size: 13px;
  color: #7c2d12;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.kw-rule-link {
  display: block;
  margin-top: 18px;
  padding: 12px 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.kw-rule-link:active { background: #e0e7ff; }

/* キーワードspan（質問・回答本文内の ≪◯≫ 部分） */
.kw-pop {
  color: #1d4ed8;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* =========================
 * カード情報セクション (heroi.cc データ表示)
 * 2026-05-20 追加
 * ========================= */

/* 2026-05-20 更新: details で折り畳み式に変更（開発・学習用、デフォルト閉じ） */
.cq-card-info {
  margin: 8px 8px;
  background: #fafbfd;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  color: #64748b;
}

/* summary（タイトル部、普段はこれだけ見える） */
.cq-card-info-summary {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  list-style: none;
  user-select: none;
}
.cq-card-info-summary::-webkit-details-marker { display: none; }
.cq-card-info-summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 6px;
  font-size: 9px;
  color: #cbd5e1;
  transition: transform 0.15s ease;
}
.cq-card-info[open] > .cq-card-info-summary::before {
  transform: rotate(90deg);
}
.cq-card-info-summary:hover {
  color: #64748b;
  background: #f1f5f9;
}

/* 開いたあとのコンテンツ部分は左右に padding */
.cq-card-info[open] {
  padding: 0 14px 12px;
}
.cq-card-info[open] > .cq-card-info-summary {
  margin: 0 -14px;  /* summary は外側にはみ出して padding をキャンセル */
}

/* バッジ群（種別・色・Lv・DP 等） */
.cq-card-info-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.cq-card-info-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f4f6fa;
  color: #171f55;
  border: 1px solid #d5dae5;
  line-height: 1.5;
}

/* 種別バッジ */
.cq-card-info-type-digimon   { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.cq-card-info-type-tamer     { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.cq-card-info-type-option    { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.cq-card-info-type-digi-egg  { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }

/* 色バッジ（デジカ公式の色を踏襲） */
.cq-card-info-color-red    { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.cq-card-info-color-blue   { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.cq-card-info-color-yellow { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.cq-card-info-color-green  { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.cq-card-info-color-black  { background: #e5e7eb; color: #1f2937; border-color: #d1d5db; }
.cq-card-info-color-purple { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.cq-card-info-color-white  { background: #fafafa; color: #525252; border-color: #e5e5e5; }

/* 特徴行 */
.cq-card-info-trait {
  font-size: 13px;
  color: #475569;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* 個別ブロック（進化条件、効果、進化元効果、セキュリティ効果） */
.cq-card-info-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}
.cq-card-info-block:first-of-type { border-top: none; padding-top: 0; }

.cq-card-info-h3 {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  margin: 0 0 6px;
  padding-left: 8px;
  border-left: 3px solid #1d4ed8;
  line-height: 1.4;
}

/* 進化条件リスト */
.cq-card-info-evo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: #171f55;
}
.cq-card-info-evo-list li {
  padding: 4px 0;
  line-height: 1.5;
}

/* 効果テキスト本文 */
.cq-card-info-effect-text {
  font-size: 14px;
  color: #171f55;
  line-height: 1.7;
  white-space: normal;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid #dbeafe;
}

/* クレジット表記 */
.cq-card-info-credit {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.6;
  text-align: center;
}
.cq-card-info-credit a {
  color: #64748b;
  text-decoration: underline;
}
.cq-card-info-credit a:hover { color: #1d4ed8; }

/* =========================
 * シェアセクション (X / LINE / URL コピー)
 * 2026-05-20 追加
 * ========================= */

.cq-share {
  /* .cq-quick-nav と同じ左右 padding にして、ボタン並びの横幅を揃える */
  margin: 20px 0 0;
  padding: 0 20px;
}
.cq-share-title {
  font-size: 13px;
  font-weight: 700;
  color: #5a6275;
  margin: 0 0 12px;
  letter-spacing: 0.05em;
  text-align: center;
}
.cq-share-buttons {
  display: flex;
  gap: 8px;
}
.cq-share-btn {
  /* flex: 1 で 3 つのボタンを等幅伸縮（カードリスト・ブックマーク一覧と同じパターン） */
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  box-sizing: border-box;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  border: 0;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  line-height: 1.2;
}
.cq-share-btn:hover  { opacity: 0.85; }
.cq-share-btn:active { transform: scale(0.97); }
.cq-share-btn:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }

.cq-share-x {
  background: #000000;
  color: #ffffff;
}
.cq-share-line {
  background: #06C755;
  color: #ffffff;
}
.cq-share-copy {
  background: #374151;
  color: #ffffff;
}
