/* ==========================================================================
   チャット形式のかんたん登録（スマホの追従バナーから開く）
   ========================================================================== */

html.ywc-open,
html.ywc-open body {
  overflow: hidden;
}

.ywc {
  position: fixed;
  inset: 0;
  z-index: 10000;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #212121;
}
.ywc[hidden] {
  display: none;
}
.ywc__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.25s;
}
.ywc__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  background: #F4F6FA;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ywc.is-open .ywc__backdrop {
  opacity: 1;
}
.ywc.is-open .ywc__panel {
  transform: translateY(0);
}
@media screen and (min-width: 768px) {
  .ywc__panel {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 400px;
    height: min(720px, calc(100vh - 48px));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  }
}

/* ヘッダー */
.ywc__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 14px;
  background: #1A3C6E;
  color: #fff;
}
.ywc__avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #E85A24;
}
.ywc__who {
  flex: 1;
  min-width: 0;
}
.ywc__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.ywc__sub {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.85;
}
.ywc__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.ywc__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* 進み具合 */
.ywc__progress {
  height: 4px;
  background: #DDE3EC;
}
.ywc__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #E85A24;
  transition: width 0.3s;
}

/* 会話ログ */
.ywc__log {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 8px;
  overscroll-behavior: contain;
}
.ywc__row {
  display: flex;
  margin-bottom: 10px;
  animation: ywc-in 0.22s ease-out;
}
.ywc__row--bot {
  justify-content: flex-start;
}
.ywc__row--user {
  justify-content: flex-end;
}
.ywc__bubble {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
}
.ywc__row--bot .ywc__bubble {
  background: #fff;
  border: 1px solid #E3E8EF;
  border-top-left-radius: 4px;
}
.ywc__row--user .ywc__bubble {
  background: #E85A24;
  color: #fff;
  font-weight: 700;
  border-top-right-radius: 4px;
}
.ywc__note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #616161;
}
.ywc__typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.ywc__typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9E9E9E;
  animation: ywc-dot 1s infinite ease-in-out;
}
.ywc__typing i:nth-child(2) { animation-delay: 0.15s; }
.ywc__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ywc-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes ywc-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 入力エリア */
.ywc__input {
  max-height: 52vh;
  overflow-y: auto;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #E3E8EF;
}
.ywc__input:empty {
  padding: 0;
  border-top: 0;
}
.ywc__choices {
  display: grid;
  gap: 8px;
}
.ywc__choices--1 { grid-template-columns: 1fr; }
.ywc__choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ywc__choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ywc__choices--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ywc__choice {
  min-height: 46px;
  padding: 8px 6px;
  border: 2px solid #1A3C6E;
  border-radius: 10px;
  background: #fff;
  color: #1A3C6E;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.ywc__choice:active,
.ywc__choice.is-selected {
  background: #1A3C6E;
  color: #fff;
}
@media (hover: hover) {
  .ywc__choice:hover {
    background: #EEF2F8;
  }
}
.ywc__select {
  display: block;
  margin-top: 10px;
}
.ywc__select-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #616161;
}
.ywc__select select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #BDBDBD;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: #212121;
}

/* テキスト入力 */
.ywc__form {
  display: flex;
  gap: 8px;
}
.ywc__text {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #BDBDBD;
  border-radius: 24px;
  font: inherit;
  font-size: 16px; /* iOS で拡大されないよう 16px 以上 */
  color: #212121;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}
.ywc__text:focus {
  outline: none;
  border-color: #1A3C6E;
  box-shadow: 0 0 0 3px rgba(26, 60, 110, 0.15);
}
.ywc__text.is-invalid {
  border-color: #E53935;
}
.ywc__send {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #E85A24;
  color: #fff;
  cursor: pointer;
}
.ywc__error {
  margin: 6px 4px 0;
  font-size: 13px;
  font-weight: 700;
  color: #E53935;
}
.ywc__error:empty {
  display: none;
}

/* 確認 */
.ywc__summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #F4F6FA;
  font-size: 13px;
  line-height: 1.5;
}
.ywc__summary dt {
  color: #616161;
}
.ywc__summary dd {
  margin: 0;
  font-weight: 700;
  word-break: break-all;
}
.ywc__submit {
  display: block;
  width: 100%;
  padding: 14px 10px;
  border: 0;
  border-bottom: 5px solid #b82e00;
  border-radius: 10px;
  background: #eb3b00;
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.ywc__submit:disabled {
  opacity: 0.7;
  cursor: default;
}
.ywc__privacy {
  margin: 8px 0 0;
  font-size: 12px;
  text-align: center;
  color: #616161;
}
.ywc__privacy a {
  color: #1A3C6E;
  text-decoration: underline;
}
.ywc__assure {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.6;
  color: #616161;
}
.ywc__assure li::before {
  content: "✓ ";
  color: #4CAF50;
  font-weight: 700;
}

.ywc__back {
  display: block;
  margin: 10px auto 0;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #757575;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .ywc__panel,
  .ywc__backdrop,
  .ywc__row {
    transition: none;
    animation: none;
  }
}

/* 任意項目の「特になし」「スキップ」 */
.ywc__skip {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #BDBDBD;
  border-radius: 24px;
  background: #fff;
  color: #616161;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ボットの発言の左にアイコン */
.ywc__row--bot {
  align-items: flex-start;
  gap: 8px;
}
.ywc__row-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E85A24;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.ywc__row-avatar svg {
  width: 19px;
  height: 19px;
}
.ywc__row-avatar.is-empty {
  visibility: hidden;
}
.ywc__row--bot .ywc__bubble {
  max-width: calc(84% - 40px);
}

/* ==========================================================================
   申込開始ポップアップ（?start=1）
   ========================================================================== */
html.ywc-intro-open,
html.ywc-intro-open body {
  overflow: hidden;
}
html.ywc-intro-open .pc-side-cta,
html.ywc-intro-open #sp-fixed-bar {
  visibility: hidden;
}
.ywc-intro {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 16px;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}
.ywc-intro__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  transition: opacity 0.2s;
}
.ywc-intro__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 34px 28px 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
  text-align: center;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.2s, transform 0.2s;
}
.ywc-intro.is-open .ywc-intro__backdrop {
  opacity: 1;
}
.ywc-intro.is-open .ywc-intro__card {
  opacity: 1;
  transform: none;
}
.ywc-intro__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9E9E9E;
  cursor: pointer;
}
.ywc-intro__badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 14px;
  border-radius: 20px;
  background: #FFF3CF;
  color: #B26A00;
  font-size: 12px;
  font-weight: 700;
}
.ywc-intro__title {
  margin: 0 0 22px;
  color: #1A3C6E;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
}
.ywc-intro__btn {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 17px 44px 15px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.ywc-intro__btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid #fff;
  transform: translateY(-50%);
}
.ywc-intro__btn--job {
  border-bottom: 4px solid #B8330B;
  background: #E85A24;
}
.ywc-intro__btn--info {
  border-bottom: 4px solid #1F7A45;
  background: #2E9E5B;
}
@media (hover: hover) {
  .ywc-intro__btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
  }
}
.ywc-intro__btn:focus-visible {
  outline: 3px solid #1A3C6E;
  outline-offset: 2px;
}
.ywc-intro__note {
  margin: 4px 0 0;
  color: #616161;
  font-size: 12px;
  line-height: 1.6;
}
@media screen and (max-width: 767px) {
  .ywc-intro__card {
    padding: 30px 18px 20px;
  }
  .ywc-intro__title {
    font-size: 18px;
  }
  .ywc-intro__btn {
    font-size: 16px;
    padding: 15px 40px 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ywc-intro__backdrop,
  .ywc-intro__card {
    transition: none;
  }
}

/* 申込開始ポップアップ・パネル形式（?start=2）：ページ内のかんたん登録フォームを中央のカードに表示 */
.ywq-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 16px;
}
.ywq-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  transition: opacity 0.2s;
}
.ywq-modal__card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 44px 20px 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.2s, transform 0.2s;
}
.ywq-modal.is-open .ywq-modal__backdrop {
  opacity: 1;
}
.ywq-modal.is-open .ywq-modal__card {
  opacity: 1;
  transform: none;
}
.ywq-modal__close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9E9E9E;
  cursor: pointer;
  z-index: 1;
}
.ywq-modal__lead {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 50px;
  margin: 0;
  color: #1A3C6E;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.ywq-modal .qf {
  margin: 0;
  max-width: none;
  box-shadow: none;
}
@media screen and (max-width: 767px) {
  .ywq-modal {
    padding: 10px;
  }
  .ywq-modal__card {
    padding: 52px 12px 14px;
  }
  .ywq-modal__lead {
    left: 14px;
    right: 48px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ywq-modal__backdrop,
  .ywq-modal__card {
    transition: none;
  }
}

/* アドバイザーのイラスト（顔アイコン） */
.ywc__avatar.is-photo,
.ywc__row-avatar.is-photo {
  overflow: hidden;
  background: #E6EEF8;
}
.ywc__avatar.is-photo {
  width: 42px;
  height: 42px;
  border: 2px solid #fff;
}
.ywc__row-avatar.is-photo {
  width: 34px;
  height: 34px;
  border: 1px solid #DDE3EC;
}
.ywc__avatar.is-photo img,
.ywc__row-avatar.is-photo img {
  display: block;
  width: 100%;
  height: 100%;
}
.ywc__row--bot .ywc__bubble {
  max-width: calc(84% - 42px);
}
.ywc-intro__avatar {
  display: block;
  width: 64px;
  height: 64px;
  margin: -6px auto 10px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(26, 60, 110, 0.18);
}
