/* ===== モーダル表示中フラグ（JSで html に付ける） ===== */
html.ts-photo-modal-open,
html.ts-photo-modal-open body{
  overflow: hidden !important;
}

/* ★ fixed が親transformの影響を受ける環境対策：モーダル中だけ無効化 */
html.ts-photo-modal-open #ts-review,
html.ts-photo-modal-open .ts,
html.ts-photo-modal-open .ts-slider-row,
html.ts-photo-modal-open .ts-slider-viewport,
html.ts-photo-modal-open .ts-slider-track{
  transform: none !important;
  filter: none !important;
  perspective: none !important;
}

/* ===== 画像モーダル本体 ===== */
.ts-photo-modal-backdrop{
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;      /* 古い環境用 */
  height: 100dvh !important;     /* 新しい環境用 */
  background: rgba(0,0,0,.6) !important;

  display: grid !important;
  place-items: center !important;
  padding: 24px !important;

  z-index: 2147483647 !important;
}

.ts-photo-modal-box{
  max-width: min(92vw, 980px) !important;
  max-height: calc(100dvh - 48px) !important;
}

.ts-photo-modal-img{
  display:block !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 96px) !important;
  border-radius:10px !important;
  box-shadow:0 10px 30px rgba(0,0,0,.4) !important;
}

/* 閉じるボタン */
.ts-photo-close{
  position: fixed !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 2147483647 !important;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 28px;
  line-height: 40px;
  cursor:pointer;
}