/* 出目チェッカー支援ポップアップ：codoc 2種類を直接表示 */
body.glab-support-popup-open { overflow: hidden; }

#glab-support-popup,
#glab-support-popup *,
.glab-support-slot,
.glab-support-slot * { box-sizing: border-box; }

#glab-support-popup { margin: 24px auto; text-align: center; }

/* 支援バナーをクリック可能な起動ボタンとして表示 */
.glab-support-slot .glab-support-popup__launch {
  appearance: none;
  display: block;
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  line-height: 0;
  transition: transform 160ms ease;
}
.glab-support-slot .glab-support-popup__launch:hover {
  transform: translateY(-2px);
}
.glab-support-slot .glab-support-popup__banner-picture,
.glab-support-slot .glab-support-popup__banner-image {
  display: block;
  width: 100%;
}
.glab-support-slot .glab-support-popup__banner-image {
  height: auto;
}
@media (min-width: 601px) and (max-width: 1599px) {
  .glab-support-slot .glab-support-popup__launch {
    width: min(100%, 960px);
  }
}

.glab-support-slot .glab-support-popup__launch:focus-visible,
#glab-support-popup .glab-support-popup__close:focus-visible {
  outline: 3px solid #74b9f2;
  outline-offset: 3px;
}

#glab-support-popup .glab-support-popup__modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 1000000;
}
#glab-support-popup .glab-support-popup__modal[hidden],
#glab-support-popup .glab-support-popup__view[hidden] { display: none; }

#glab-support-popup .glab-support-popup__backdrop {
  background: rgba(4,17,31,.68);
  inset: 0;
  position: absolute;
}
#glab-support-popup .glab-support-popup__dialog {
  background: #fff;
  border: 1px solid rgba(31,111,174,.14);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,25,52,.3);
  color: #172536;
  max-height: min(90vh, 760px);
  max-width: 740px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 34px 30px 30px;
  position: relative;
  text-align: left;
  width: 100%;
  z-index: 1;
}
#glab-support-popup .glab-support-popup__close {
  align-items: center;
  appearance: none;
  background: #edf5fc;
  border: 0;
  border-radius: 50%;
  color: #31546f;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 27px;
  height: 40px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  position: absolute;
  right: 14px;
  top: 14px;
  transition: background 160ms ease, color 160ms ease;
  width: 40px;
  z-index: 2;
}
#glab-support-popup .glab-support-popup__close:hover {
  background: #dcecf9;
  color: #0f5f9d;
}
#glab-support-popup .glab-support-popup__view { width: 100%; }
#glab-support-popup .glab-support-popup__title {
  color: #123c5d;
  font-size: clamp(20px,3vw,26px);
  font-weight: 700;
  line-height: 1.4;
  margin: 6px 46px 14px;
  text-align: center;
}
#glab-support-popup .glab-support-popup__intro {
  color: #4d6172;
  font-size: 14px;
  line-height: 1.8;
  margin: 0 auto 14px;
  max-width: 590px;
  text-align: center;
}

/* 単発・月額 codoc ウィジェットを横並び */
#glab-support-popup .glab-support-popup__choices {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  align-items: center;
}
#glab-support-popup .glab-support-popup__choices > .glab-support-popup__widget {
  min-width: 0;
  width: 100%;
}
#glab-support-popup .glab-support-popup__widget {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}
#glab-support-popup .glab-support-popup__widget > * { max-width: 100%; }

/* 月額支援のサムネイル領域を非表示 */
#glab-support-popup .codoc-siteSubscription-subscription .codoc-image { display: none !important; }

/* 月額支援を単発支援と同じ青いカードに統一 */
#glab-support-popup .codoc-siteSubscription-subscription {
  background: #367bf0 !important;
  border-radius: 5px !important;
  color: #fff !important;
  height: 156px;
  min-height: 156px;
  transform: translateY(-8px);
  padding: 24px 20px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
#glab-support-popup .codoc-siteSubscription-subscription .codoc-info {
  width: 100% !important;
  text-align: center !important;
}
#glab-support-popup .codoc-siteSubscription-subscription .codoc-title,
#glab-support-popup .codoc-siteSubscription-subscription .codoc-labels {
  display: none !important;
}
#glab-support-popup .codoc-siteSubscription-subscription .codoc-discription {
  color: #fff !important;
  font-weight: 700 !important;
  text-align: center !important;
  margin: 0 0 20px !important;
}
#glab-support-popup .codoc-siteSubscription-subscription .codoc-price {
  width: 100% !important;
  text-align: center !important;
}
#glab-support-popup .codoc-siteSubscription-subscription .codoc-btn {
  background: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #367bf0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100% !important;
  font-weight: 700 !important;
  font-size: 0 !important;
}
#glab-support-popup .codoc-siteSubscription-subscription .codoc-btn::after {
  content: "継続支援する";
  font-size: 14px;
  font-weight: 700;
}
#glab-support-popup .codoc-siteSubscription-subscription .codoc-btn:hover {
  background: #f1f6ff !important;
  color: #246bd7 !important;
}

@media (max-width:600px) {
  #glab-support-popup { margin: 18px auto; }
  .glab-support-slot .glab-support-popup__launch { width: min(100%, 440px); }
  #glab-support-popup .glab-support-popup__modal { align-items: flex-start; padding: 12px; }
  #glab-support-popup .glab-support-popup__dialog {
    border-radius: 13px;
    margin: auto 0;
    max-height: calc(100dvh - 24px);
    padding: 28px 16px 22px;
  }
  #glab-support-popup .glab-support-popup__close { height: 36px; right: 9px; top: 9px; width: 36px; }
  #glab-support-popup .glab-support-popup__title { font-size: 19px; margin: 8px 38px 12px; }
  #glab-support-popup .glab-support-popup__intro { font-size: 13px; margin-bottom: 18px; }
  #glab-support-popup .glab-support-popup__choices { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion:reduce) {
  .glab-support-slot .glab-support-popup__launch,
  #glab-support-popup .glab-support-popup__close { transition: none; }
}

/* 単発支援下のヘルプ・powered by codocを非表示 */
#glab-support-popup .codoc-copyright.codoc-copyright-small {
  visibility: hidden !important;
}
/* codoc月額支援のログイン・会員登録画面：ボタン表示文言のみ変更 */
.codoc-site-modal .codoc-link-section:nth-of-type(1) .codoc-modal-default-button > span,
.codoc-site-modal .codoc-link-section:nth-of-type(2) .codoc-modal-default-button > span {
  font-size: 0 !important;
}
.codoc-site-modal .codoc-link-section:nth-of-type(1) .codoc-modal-default-button > span::after {
  content: "ログインして支援する";
  font-size: 12px;
}
.codoc-site-modal .codoc-link-section:nth-of-type(2) .codoc-modal-default-button > span::after {
  content: "会員登録して支援する";
  font-size: 12px;
}

/* 決済完了時のお礼画像だけに適用（通常の支援選択画面は変更しない） */
#glab-support-popup .glab-support-popup__dialog:has([data-glab-support-view="thanks"]:not([hidden])) {
  max-width: 1100px;
  max-height: 90dvh;
  padding: 0;
  overflow: hidden;
}

#glab-support-popup .glab-support-popup__thanks-picture,
#glab-support-popup .glab-support-popup__thanks-image {
  display: block;
  width: 100%;
}

#glab-support-popup .glab-support-popup__thanks-image {
  height: auto;
  max-height: 90dvh;
  object-fit: contain;
}

/* お礼画像上の閉じるボタン（実際に動作する既存ボタン） */
#glab-support-popup .glab-support-popup__dialog:has([data-glab-support-view="thanks"]:not([hidden])) > .glab-support-popup__close {
  background: rgba(255, 255, 255, 0.95);
  right: 12px;
  top: 12px;
}

@media (max-width: 600px) {
  #glab-support-popup .glab-support-popup__dialog:has([data-glab-support-view="thanks"]:not([hidden])) {
    width: min(100%, 420px);
    max-height: calc(100dvh - 24px);
  }

  #glab-support-popup .glab-support-popup__thanks-image {
    max-height: calc(100dvh - 24px);
  }
}
/* ショートコード配置：デスクトップ/モバイルの表示を切り替える */
.glab-support-slot { margin:24px auto; text-align:center; }
@media (min-width:1600px) { .glab-support-slot--mobile { display:none!important; } }
@media (max-width:1599px) { .glab-support-slot--desktop { display:none!important; } }
