/* =================================================
   タグ編集モーダル：基本文字色
================================================= */

#tag-edit-modal .modal-content {
  color: #4B4B69;
}


/* =================================================
   タグ共通ピル（すべてのタグの見た目基準）
================================================= */

#tag-edit-modal .tag-vote-pill,
#tag-edit-modal .tag-own-pill,
#tag-edit-modal .tag-pill {
  appearance: none;
  -webkit-appearance: none;

  background: var(--rc-pill, #F7FCFF);
  border: 1px solid var(--rc-btn-border, #d8eef8);
  border-radius: 999px;

  padding: 4px 10px;
  margin: 0;

  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;

  color: #4B4B69;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* hover 統一 */
#tag-edit-modal .tag-vote-pill:hover,
#tag-edit-modal .tag-own-pill:hover,
#tag-edit-modal .tag-pill:hover {
  background: var(--rc-pill-active, #FFE5EF);
}


/* =================================================
   👍 投票UI（内部構造）
================================================= */

#tag-edit-modal .tag-vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#tag-edit-modal .tag-vote-icon {
  font-size: 13px;
  line-height: 1;
  color: #4B4B69;   /* 👍が黒になる問題の修正点 */
}

#tag-edit-modal .tag-vote-count {
  font-size: 12px;
  line-height: 1;
  color: #4B4B69;
}


/* =================================================
   👍 投票済み状態（自分が投票したタグ）
================================================= */

#tag-edit-modal .tag-vote-pill.is-my-vote {
  background: #FFE5EF;
  border-color: #f2b8c8;
  font-weight: 600;
}

#tag-edit-modal .tag-vote-pill.is-my-vote .tag-vote-icon {
  color: #E97EA1;   /* 投票済みだけピンク */
}


/* =================================================
   タグ多すぎ対策（20件以上）
================================================= */

#tag-edit-modal .tag-edit-tags.is-collapsed {
  max-height: 96px;     /* 約4行 */
  overflow: hidden;
  position: relative;
}

/* 下部フェード */
#tag-edit-modal .tag-edit-tags.is-collapsed::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 32px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    #fff
  );
  pointer-events: none;
}


/* =================================================
   「もっと見る」ボタン（唯一の定義）
================================================= */

#tag-edit-modal .tag-more-btn {
  display: inline-block;
  margin-top: 6px;

  padding: 8px 20px;
  border-radius: 999px;

  background: #F7FCFF;
  border: 1px solid #D0EFFF;
  color: #4B4B69;

  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#tag-edit-modal .tag-more-btn:hover {
  background: #D3EDFE;
}









/* =================================================
   自分の提案タグ：入力UIのデザイン統一
================================================= */

#tag-edit-modal .tag-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

/* 入力欄 */
#tag-edit-modal #tag-new-input {
  appearance: none;
  -webkit-appearance: none;

  height: 28px;
  padding: 4px 10px;

  border-radius: 999px;
  border: 1px solid var(--rc-btn-border, #d8eef8);
  background: #FCFCFC;

  font-size: 13px;
  line-height: 1.2;
  color: #4B4B69;

  outline: none;
  min-width: 180px;
}

#tag-edit-modal #tag-new-input::placeholder {
  color: #9aa0b5;
}

/* フォーカス時 */
#tag-edit-modal #tag-new-input:focus {
  background: #FFFFFF;
  border-color: #E97EA1;
  box-shadow: 0 0 0 2px rgba(233,126,161,0.15);
}


/* 追加ボタン（タグピル化） */
#tag-edit-modal #tag-new-submit {
  appearance: none;
  -webkit-appearance: none;

  background: var(--rc-pill, #F7FCFF);
  border: 1px solid var(--rc-btn-border, #d8eef8);
  border-radius: 999px;

  padding: 4px 14px;
  height: 28px;

  font-size: 13px;
  font-weight: 600;
  color: #4B4B69;

  cursor: pointer;
  white-space: nowrap;
}

#tag-edit-modal #tag-new-submit:hover {
  background: var(--rc-pill-active, #FFE5EF);
}

#tag-edit-modal #tag-new-submit:active {
  transform: translateY(0.5px);
}







/* =========================================
   タグ編集モーダル：閉じるボタンを右下へ
========================================= */

/* パネルを基準にする */
#tag-edit-modal .modal-content{
  position: relative;
  padding-bottom: 72px; /* 右下ボタンぶんの逃げ */
}

/* actions を右下に固定 */
#tag-edit-modal .modal-actions{
  position: absolute;
  right: 16px;
  bottom: 16px;
  margin: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 閉じるボタン見た目（任意：既存に合わせる） */
#tag-edit-modal #tag-edit-cancel{
  border-radius: 12px;
  padding: 10px 16px;
  background: #F7FCFF;
  color: #4B4B69;
  border: 1px solid #D0EFFF;
  cursor: pointer;
}
#tag-edit-modal #tag-edit-cancel:hover{
  background: #D3EDFE;
}
















/* ===============================
   タグ一覧モーダル（復旧・最小版）
   =============================== */

/* モーダル全体 */
.tag-list-modal{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}
.tag-list-modal.is-open{
  display: block;
}

/* 背景オーバーレイ */
.tag-list-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}










/* =========================================
   tag-list-modal 170-3
   昔の完成形・最小安定版
========================================= */

.tag-list-modal{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  background: rgba(0,0,0,0.35);
}

.tag-list-modal.is-open{
  display: block;
}



.tag-list-modal__header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

.tag-list-modal__title{
  font-size: 18px;
  font-weight: 700;
}

.tag-list-modal__close{
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.tag-list-modal__body{
  padding: 16px;
  overflow: auto;
}

/* フィルタ行（最低限） */
.tag-list-filter-row,
.kana-filter-row{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag-list-filter-btn,
.kana-filter-btn{
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.tag-list-filter-btn.is-active{
  background: #E97EA1;
  color: #fff;
  border-color: #E97EA1;
}

/* 一覧 */
.tag-list-container{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 12px;
}

.tag-list-row{
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.tag-list-row:hover,
.tag-list-row:focus-visible{
  background: #f6fcff;
  border-color: #b8e4ff;
  box-shadow: 0 3px 10px rgba(82, 98, 130, .12);
  outline: none;
}

.tag-list-row:active{
  transform: translateY(1px);
}

/* もっと見る */
.tag-list-more-btn{
  margin: 16px auto 0;
  display: block;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #D3EFFF;
  cursor: pointer;
}


/* =========================
   モーダル表示中：背景スクロール禁止
========================= */

body.is-modal-open{
  overflow: hidden;

}









/* =========================
   タグ一覧モーダル：中だけスクロール
========================= */

/* モーダル全体（開いた時だけ表示される想定） */
#tag-list-modal{
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none; /* is-open で表示 */
}
#tag-list-modal.is-open{ display: block; }

/* 背景オーバーレイ */
#tag-list-modal .tag-list-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}



/* ヘッダーは固定、ボディだけ伸びる */
#tag-list-modal .tag-list-modal__header{
  flex: 0 0 auto;
}

/* ★ここがスクロール領域 */
#tag-list-modal .tag-list-modal__body{
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}






/* ===============================
   タグ一覧モーダル：最終安定版
=============================== */

#tag-list-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  z-index: 2147483647;
}

#tag-list-modal.is-open {
  display: grid;
  place-items: center; /* ★ 完全センター */
}

#tag-list-modal .tag-list-modal__panel {
  width: min(90vw, 640px);   /* ← 小さくする */
  max-height: 72vh;          /* ← 高さも抑える */
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}






/* 検索入力をピル型に */
#tag-list-modal .tag-list-search input{
  width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rc-border);
  background: #fff;
  font-size: 14px;
}



/* 対象セレクト全体 */
#tag-list-modal .tag-list-target-row{
  margin-top: 10px;
}

/* select をピル化 */
#tag-list-modal .tag-list-target-row select{
  appearance: none;
  padding: 8px 36px 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rc-border);
  background:
    #fff
    url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'>\
<path fill='%234B4B69' d='M7 10l5 5 5-5z'/>\
</svg>")
    no-repeat right 12px center;
  font-size: 14px;
  cursor: pointer;
}




#tag-list-modal .tag-list-modal__footer{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;

  padding: 16px;
  border-top: 1px solid #f0f0f0;
  background: #fff;

  /* ここが超重要 */
  position: sticky;
  bottom: 0;
  z-index: 5;
}


.tag-list-modal__panel{
  display: flex;
  flex-direction: column;
}

.tag-list-modal__body{
  flex: 1;
  overflow-y: auto;
}

.tag-list-modal__footer{
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid #eee;
  background: #fff;
}


/* /assets/css/（タグ一覧モーダルのCSSが入ってる場所）
   既存の #tag-list-modal .tag-list-modal__footer と
   #tag-list-modal .tag-list-modal__close-bottom を “このまま丸ごと” 置き換え */

/* フッター：もっと見る(中央) ＋ 閉じる(右) */
#tag-list-modal .tag-list-modal__footer{
  position: sticky;
  bottom: 0;
  z-index: 10;

  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;

  gap: 12px;
  padding: 12px 14px;

  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
}

/* もっと見るは常に中央 */
#tag-list-modal .tag-list-modal__footer .tag-list-more-wrapper{
  justify-self: center;
}

/* 閉じるボタン：マイリストの閉じる寄せ（角丸四角・薄い枠・軽い影） */
#tag-list-modal .tag-list-modal__close-bottom{
  justify-self: end;

  padding: 10px 16px;
  border-radius: 12px;

  border: 1px solid #d8eef8;  /* ←マイリスト寄せの薄い枠 */
  background: #fff;
  color: #4B4B69;

  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

/* hoverも控えめ */
#tag-list-modal .tag-list-modal__close-bottom:hover{
  background: #F7FCFF;
}





