/* アンケート追従バナー（外部ページへ遷移）*/
:root {
  --sp-bg: #fff;
  --sp-text: #222;
  --sp-deep: #005b96;
  --sp-accent: #0072bc;
  --sp-light: #19a3fc;
  --sp-accent-text: #fff;
  --sp-space-1: 8px;
  --sp-space-2: 16px;
  --sp-space-3: 24px;
  --sp-width: 280px;
}

.survey-panel {
  position: fixed;
  right: var(--sp-space-3);
  bottom: var(--sp-space-3);
  z-index: 900000000;
  box-sizing: border-box;
  width: var(--sp-width);
  background: var(--sp-bg);
  color: var(--sp-text);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 50, 90, .28);
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.7;
  text-align: left;
  transform: translateX(calc(100% + var(--sp-space-3) * 2));
  visibility: hidden;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), visibility 0s .5s;
}
.survey-panel.is-show {
  transform: translateX(0);
  visibility: visible;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}

.survey-panel__link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
}
.survey-panel__link:focus-visible {
  outline: 3px solid #f5a300;
  outline-offset: 2px;
}

/* 上部：記事内バナーと同じグラデ＋ドット */
.survey-panel__head {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--sp-space-2) var(--sp-space-2);
  overflow: hidden;
  background:
    radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1.5px) 0 0 / 16px 16px,
    linear-gradient(115deg, var(--sp-deep) 0%, var(--sp-accent) 60%, #1388d4 100%);
  color: var(--sp-accent-text);
}
.survey-panel__head::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 20px solid rgba(255, 255, 255, .1);
}
.survey-panel__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: 12px;
  border-radius: 50%;
  background: #fff;
  color: var(--sp-accent);
}
.survey-panel__icon svg {
  width: 28px;
  height: 28px;
}
.survey-panel__label {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .2em;
}

.survey-panel__body {
  display: block;
  padding: var(--sp-space-2);
}
.survey-panel__title {
  display: block;
  margin-bottom: 4px;
  color: var(--sp-deep);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  padding-bottom: 10px;
}
.survey-panel__text {
  display: block;
  margin-bottom: var(--sp-space-2);
  color: #444;
  font-size: 14px;
  line-height: 1.7;
}
.survey-panel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--sp-space-1) 0 var(--sp-space-2);
  border-radius: 50px;
  background: var(--sp-accent);
  color: var(--sp-accent-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: background-color .3s;
}
.survey-panel__arrow {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  margin-left: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .3s;
}
.survey-panel__arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--sp-accent);
  border-right: 2px solid var(--sp-accent);
  transform: translate(-70%, -50%) rotate(45deg);
}
.survey-panel__link:hover .survey-panel__btn { background: var(--sp-deep); }
.survey-panel__link:hover .survey-panel__arrow { transform: translateX(4px); }

/* 閉じる：グラデ部分の右上（見た目32px／タップ44px） */
.survey-panel__close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.survey-panel__close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  background: rgba(0, 30, 60, .35);
  transition: background-color .3s;
}
.survey-panel__close span::before,
.survey-panel__close span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  background: #fff;
  transform: rotate(45deg);
}
.survey-panel__close span::after { transform: rotate(-45deg); }
.survey-panel__close:hover span { background: rgba(0, 30, 60, .6); }
.survey-panel__close:focus-visible {
  outline: 3px solid #f5a300;
  outline-offset: -2px;
  border-radius: 50%;
}

/* 中間幅：本文への被りを減らすため少し小さく */
@media (min-width: 769px) and (max-width: 1100px) {
  .survey-panel {
    --sp-width: 248px;
    right: var(--sp-space-2);
    bottom: var(--sp-space-2);
  }
  .survey-panel__title { font-size: 18px; }
}

/* タブレット縦・スマホ：画面下の帯（案件のBP 768） */
@media (max-width: 768px) {
  .survey-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    border-radius: 0;
    box-shadow: 0 -4px 16px rgba(0, 50, 90, .2);
    transform: translateY(100%);
  }
  .survey-panel.is-show { transform: translateY(0); }
  .survey-panel__link {
    display: flex;
    align-items: center;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background:
      radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.5px) 0 0 / 16px 16px,
      linear-gradient(115deg, var(--sp-deep) 0%, var(--sp-accent) 70%, #1388d4 100%);
    color: var(--sp-accent-text);
  }
  .survey-panel__head {
    padding: 12px 0 12px var(--sp-space-2);
    background: none;
  }
  .survey-panel__head::before,
  .survey-panel__label,
  .survey-panel__text { display: none; }
  .survey-panel__icon {
    width: 44px;
    height: 44px;
  }
  .survey-panel__body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 12px var(--sp-space-2) 12px 0;
  }
  .survey-panel__title {
    margin: 0 12px 0 0;
    color: var(--sp-accent-text);
    font-size: 16px;
  }
  .survey-panel__btn {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 6px 0 var(--sp-space-2);
    background: #fff;
    color: var(--sp-accent);
  }
  .survey-panel__arrow { background: var(--sp-light); }
  .survey-panel__arrow::before { border-color: #fff; }
  .survey-panel__link:hover .survey-panel__btn { background: #fff; }
  /* 閉じる：帯の上辺に半分かかる位置 */
  .survey-panel__close {
    top: -22px;
    right: 4px;
  }
  .survey-panel__close span { background: #333; }
  .survey-panel__close:hover span { background: #000; }
}

/* スマホ（案件のBP 600） */
@media (max-width: 600px) {
  .survey-panel__title { font-size: 15px; }
}
@media (max-width: 360px) {
  .survey-panel__title { font-size: 14px; }
  .survey-panel__btn { font-size: 14px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .survey-panel,
  .survey-panel.is-show,
  .survey-panel__arrow { transition: none; }
  .survey-panel__link:hover .survey-panel__arrow { transform: none; }
}
