/* AIMONDB Column Selector Modal */

.tmdb-cols-btn{
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.15);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.tmdb-cols-btn:hover{ background: rgba(0,0,0,.25); }

/* In the lightweight (search results) bar, background is white */
.aimondb-search-v2 .tmdb-cols-btn{
  border: 1px solid rgba(0,0,0,.2);
  background: #fff;
  color: #111;
}

.aimondb-search-v2 .tmdb-cols-btn:hover{ background: rgba(0,0,0,.04); }

.tmdb-colmodal-backdrop{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.55);
  z-index: 999999;
}

.tmdb-colmodal-backdrop.is-open{ display: flex; }

.tmdb-colmodal{
  width: min(760px, 100%);
  background: #121827;
  color: #fff;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 60px rgba(0,0,0,.6);
  overflow: hidden;
}

.tmdb-colmodal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.tmdb-colmodal-header h3{
  margin: 0;
  font-size: 16px;
}

.tmdb-colmodal-close{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.15);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.tmdb-colmodal-close:hover{ background: rgba(0,0,0,.25); }

.tmdb-colmodal-body{ padding: 14px 16px 4px; }

.tmdb-colmodal-note{
  margin: 0 0 10px;
  opacity: .85;
  font-size: 13px;
}

.tmdb-colmodal-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
  padding: 8px 2px 14px;
}

.tmdb-colmodal-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}

.tmdb-colmodal-item input{ transform: scale(1.05); }

.tmdb-colmodal-item label{
  cursor: pointer;
  font-size: 14px;
}

.tmdb-colmodal-footer{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.12);
}

.tmdb-colmodal-spacer{ flex: 1; }

.tmdb-colmodal-btn{
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.15);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
}

.tmdb-colmodal-btn:hover{ background: rgba(0,0,0,.25); }

.tmdb-colmodal-btn-primary{
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
}

.tmdb-colmodal-btn-primary:hover{ background: rgba(255,255,255,.14); }

.tmdb-colmodal-btn-reset{
  opacity: .9;
}

@media (max-width: 480px){
  .tmdb-colmodal-grid{ grid-template-columns: 1fr; }
  .tmdb-cols-btn{ padding: 10px 12px; font-size: 13px; }
}

/* === FIX: mobile scroll + smaller UI (2026-01-07) === */

/* Make modal height constrained and allow inner scroll */
.tmdb-colmodal{
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

.tmdb-colmodal-header,
.tmdb-colmodal-footer{ flex: 0 0 auto; }

.tmdb-colmodal-body{
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Slightly smaller typography overall */
.tmdb-colmodal{ font-size: 13px; }
.tmdb-colmodal-header h3{ font-size: 15px; }
.tmdb-colmodal-item label{ font-size: 13px; }

@media (max-width: 480px){
  .tmdb-colmodal-backdrop{ padding: 10px; }
  .tmdb-colmodal{ border-radius: 14px; max-height: calc(100vh - 20px); }
  .tmdb-colmodal-header{ padding: 10px 12px; }
  .tmdb-colmodal-body{ padding: 10px 12px 2px; }
  .tmdb-colmodal-footer{ padding: 10px 12px; }
  .tmdb-colmodal-note{ font-size: 12px; }
  .tmdb-colmodal-item{ padding: 8px 10px; border-radius: 12px; }
  .tmdb-colmodal-close{ width: 32px; height: 32px; font-size: 18px; }
}


/* === PC版 チェックボックスフォント縮小 === */
@media (min-width: 769px){
  .tmdb-colmodal label,
  .tmdb-colmodal .tmdb-colitem{
    font-size: 12px;
    line-height: 1.25;
  }
  .tmdb-colmodal input[type="checkbox"]{
    transform: scale(0.9);
    margin-right: 6px;
  }
}


/* === PC版：表示列カード内フォントをさらに1段詰める === */
@media (min-width: 769px){
  .tmdb-colmodal .tmdb-colitem,
  .tmdb-colmodal label{
    font-size: 12px;
    line-height: 1.15;
    letter-spacing: 0.015em;
  }
}


/* === PC版：表示列カード（button実体）の文字サイズ強制縮小 === */
@media (min-width: 769px){
  .tmdb-colmodal button{
    font-size: 12px !important;
    line-height: 1.15;
    letter-spacing: 0.01em;
  }
  .tmdb-colmodal button span{
    font-size: 12px !important;
  }
}


/* === REAL FIX: 生成される要素に合わせてPC版フォントを確実に縮小 ===
   wrap: <label class="tmdb-colmodal-item">
   text: <span class="tmdb-colmodal-item-label">
*/
@media (min-width: 769px){
  .tmdb-colmodal label.tmdb-colmodal-item{
    font-size: 12px !important;
    line-height: 1.15;
  }
  .tmdb-colmodal .tmdb-colmodal-item-label{
    font-size: 12px !important;
    line-height: 1.15;
    letter-spacing: 0.01em;
  }
}
