/* ------------------------------
チャット型お部屋探し受付
構造はアキラッキーLPのチャット（chat.css v4）を踏襲、見た目はCOCO ROOM LPに合わせる
- 黄 #FFBB00（地色・アイコン）/ 蛍光黄 #FFF600（強調）/ クリーム #FFF7D9（背景）/ オレンジ #FC5800（強調文字・必須）
- 黒 #161616 の太枠＋ずらし影、行動ボタンだけ緑 #00C700（LPの「今すぐお部屋を探す」と同じ）
- 見出し・ボタンは Zen Kaku Gothic Antique、英字の飾りは Montserrat（LPで読み込み済み）
- 枠は max-width 480px。PCでもスマホ幅で中央に出る
- 操作エリアは固定せず、下に大きな余白（.chat-tail）を置いてキーボードと被らせない
------------------------------ */
.chat-overlay {
  --cr-yellow: #FFBB00;
  --cr-lemon: #FFF600;
  --cr-cream: #FFF7D9;
  --cr-orange: #FC5800;
  --cr-green: #00C700;
  --cr-ink: #161616;
  --cr-gray: #8a8a8a;
  background: var(--cr-yellow);
  color: var(--cr-ink);
  font-family: "Zen Kaku Gothic Antique", "Noto Sans JP", sans-serif;
  height: 100%;
  height: 100dvh;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: fixed;
  z-index: 9999;
}
.chat-overlay[hidden] {
  display: none;
}
.chat-frame {
  background: var(--cr-cream);
  margin: 0 auto;
  max-width: 480px;
  min-height: 100%;
}
.chat-devnote {
  background: var(--cr-ink);
  color: var(--cr-lemon);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  text-align: center;
}

/* ヘッダー：LPのヘッダーと同じ白地＋ロゴ */
.chat-header {
  align-items: center;
  background: #fff;
  display: flex;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.chat-header-logo {
  flex-shrink: 0;
  height: auto;
  width: 112px;
}
.chat-header-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.chat-header-read {
  color: var(--cr-yellow);
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}
.chat-header-sub {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}
.chat-iconbtn {
  background: var(--cr-yellow);
  border: 2px solid var(--cr-ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 0 var(--cr-ink);
  color: var(--cr-ink);
  cursor: pointer;
  display: grid;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 900;
  height: 40px;
  line-height: 1;
  place-items: center;
  width: 40px;
  -webkit-tap-highlight-color: transparent;
}
.chat-iconbtn:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

/* 残り表示：LPの「＼ ○○をスタート！ ／」の帯 */
.chat-remain {
  background: var(--cr-yellow);
  border-bottom: 2px solid var(--cr-ink);
  border-top: 2px solid var(--cr-ink);
  font-size: 14px;
  font-weight: 900;
  margin: 0;
  padding: 7px 14px;
  position: sticky;
  text-align: center;
  top: 60px;
  z-index: 1;
}
.chat-remain-text {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}
.chat-remain-text::before,
.chat-remain-text::after {
  background: no-repeat center/contain;
  content: "";
  display: inline-block;
  height: 16px;
  width: 11px;
}
.chat-remain-text::before {
  background-image: url(../images/common/line-text-decoration-left.svg);
}
.chat-remain-text::after {
  background-image: url(../images/common/line-text-decoration-right.svg);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px 0;
}
.chat-tail {
  height: 60vh;
}

/* 吹き出し：LPの「住みたいお部屋を〜」の黒枠吹き出し */
.chat-row {
  align-items: flex-start;
  display: flex;
  gap: 8px;
}
.chat-avatar {
  background: var(--cr-yellow) center / cover no-repeat;
  border: 2px solid var(--cr-ink);
  border-radius: 50%;
  display: grid;
  flex-shrink: 0;
  height: 42px;
  place-items: center;
  width: 42px;
}
.chat-avatar svg {
  fill: #fff;
  height: 24px;
  width: 24px;
}
.chat-bubble {
  background: #fff;
  border: 2px solid var(--cr-ink);
  border-radius: 4px 18px 18px 18px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  max-width: calc(100% - 56px);
  padding: 10px 14px;
  word-break: break-word;
}
.chat-bubble strong {
  color: var(--cr-orange);
  font-weight: 900;
}
.chat-bubble-note {
  color: var(--cr-gray);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}
.chat-typing {
  display: flex;
  gap: 5px;
  padding: 6px 0;
}
.chat-typing span {
  animation: chat-dot 1s infinite ease-in-out;
  background: var(--cr-yellow);
  border-radius: 50%;
  height: 8px;
  width: 8px;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* 選択タイル：LPのQ&Aカード（白地・黄色の丸アイコン・黄色の矢印） */
.chat-tiles {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.chat-tile {
  align-items: center;
  background: #fff;
  border: 2px solid var(--cr-ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 0 var(--cr-ink);
  color: var(--cr-ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  gap: 8px;
  justify-content: center;
  min-height: 108px;
  padding: 14px 8px;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.chat-tile:active {
  box-shadow: 1px 1px 0 0 var(--cr-ink);
  transform: translate(2px, 2px);
}
@media (any-hover: hover) {
  .chat-tile:hover {
    background: var(--cr-cream);
  }
}
.chat-tile::after {
  border-bottom: 3px solid var(--cr-yellow);
  border-right: 3px solid var(--cr-yellow);
  bottom: 12px;
  content: "";
  height: 7px;
  position: absolute;
  right: 12px;
  transform: rotate(-45deg);
  width: 7px;
}
.chat-tile-icon {
  background: var(--cr-yellow);
  border-radius: 50%;
  display: grid;
  height: 44px;
  place-items: center;
  width: 44px;
}
.chat-tile-icon svg {
  fill: #fff;
  height: 25px;
  width: 25px;
}
.chat-tile span:last-child {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}
.chat-tile--wide {
  flex-direction: row;
  grid-column: 1 / -1;
  min-height: 68px;
  padding: 12px 16px;
}
.chat-tile--wide .chat-tile-icon {
  height: 38px;
  width: 38px;
}
.chat-tile--wide .chat-tile-icon svg {
  height: 21px;
  width: 21px;
}
/* 選んだあと：選んだものを蛍光黄、ほかは控えめに（押し直し可） */
.chat-tiles.is-decided .chat-tile {
  border-color: #c9c2a0;
  box-shadow: none;
  color: var(--cr-gray);
}
.chat-tiles.is-decided .chat-tile-icon {
  background: #e9e2c4;
}
.chat-tiles.is-decided .chat-tile::after {
  border-color: #d8d1b0;
}
.chat-tiles.is-decided .chat-tile.is-selected {
  background: var(--cr-lemon);
  border-color: var(--cr-ink);
  box-shadow: 3px 3px 0 0 var(--cr-ink);
  color: var(--cr-ink);
}
.chat-tiles.is-decided .chat-tile.is-selected .chat-tile-icon {
  background: var(--cr-orange);
}
.chat-tiles.is-decided .chat-tile.is-selected::after {
  border-color: var(--cr-orange);
  height: 12px;
  transform: rotate(45deg);
  width: 6px;
}

/* 入力カード */
.chat-card {
  background: #fff;
  border: 2px solid var(--cr-ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 0 var(--cr-ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px 16px;
}
.chat-field {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 82px 1fr;
}
.chat-field-label {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
}
.chat-req,
.chat-opt {
  border-radius: 4px;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  padding: 1px 5px;
  vertical-align: 1px;
}
.chat-req {
  background: var(--cr-orange);
  color: #fff;
}
.chat-opt {
  background: #e9e2c4;
  color: var(--cr-ink);
}
.chat-input {
  background: var(--cr-cream);
  border: 2px solid var(--cr-ink);
  border-radius: 10px;
  color: var(--cr-ink);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 18px; /* 16px以上でiOSの自動ズームを防ぐ */
  font-weight: 700;
  min-width: 0;
  padding: 12px;
  width: 100%;
}
.chat-input::placeholder {
  color: #bdb594;
}
.chat-input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px var(--cr-lemon);
  outline: none;
}
.chat-input:disabled {
  background: #f2f2f2;
  color: var(--cr-gray);
}
.chat-select {
  appearance: none;
  background: var(--cr-cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23FFBB00'/%3E%3C/svg%3E") right 8px center / 26px no-repeat;
  padding-right: 36px;
}
.chat-hp {
  height: 1px;
  left: -9999px;
  opacity: 0;
  position: absolute;
  width: 1px;
}
.chat-error {
  color: var(--cr-orange);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}
.chat-error[hidden] {
  display: none;
}
.chat-consent-row {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
}
/* LP本体のCSSが input[type=checkbox] を display:none にしているので、チャット内だけ表示し直す */
.chat-overlay .chat-consent-check {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  border: 2px solid var(--cr-ink);
  border-radius: 6px;
  cursor: pointer;
  display: inline-grid !important;
  flex-shrink: 0;
  height: 24px;
  margin: 0;
  place-content: center;
  width: 24px;
}
.chat-overlay .chat-consent-check::before {
  border-bottom: 3px solid #fff;
  border-right: 3px solid #fff;
  content: "";
  height: 11px;
  margin-top: -3px;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s ease-out;
  width: 6px;
}
.chat-overlay .chat-consent-check:checked {
  background: var(--cr-green);
}
.chat-overlay .chat-consent-check:checked::before {
  transform: rotate(45deg) scale(1);
}
.chat-overlay .chat-consent-check:focus-visible {
  box-shadow: 0 0 0 3px var(--cr-lemon);
  outline: none;
}
.chat-consent-text a {
  color: var(--cr-ink);
  text-decoration: underline;
  text-decoration-color: var(--cr-yellow);
  text-decoration-thickness: 2px;
}

/* 行動ボタン：LPの「今すぐお部屋を探す」（.c-link）と同じ緑のピル＋白矢印 */
.chat-next {
  align-items: center;
  background: var(--cr-green);
  border: 2px solid var(--cr-ink);
  border-radius: 100vmax;
  box-shadow: 3px 3px 0 0 var(--cr-ink);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  gap: 16px;
  justify-content: center;
  letter-spacing: 0.05em;
  padding: 16px;
  transition: color 0.3s ease-out, background-color 0.3s ease-out;
  width: 100%;
}
.chat-next::after {
  background: url(../images/common/arrow-white.svg) no-repeat center/cover;
  content: "";
  display: inline-block;
  height: 16px;
  width: 10px;
}
@media (any-hover: hover) {
  .chat-next:not(:disabled):hover {
    background: #fff;
    color: var(--cr-green);
  }
  .chat-next:not(:disabled):hover::after {
    background-image: url(../images/common/arrow-green.svg);
  }
}
.chat-next:disabled {
  background: #d6d6d6;
  border-color: #b5b5b5;
  box-shadow: none;
  cursor: default;
}
.chat-next:disabled::after {
  opacity: 0.6;
}
/* 押せる状態になったら揺らして最後の一押しを促す */
.chat-next--pulse {
  animation: chat-pulse 1.6s ease-in-out infinite;
}
@keyframes chat-pulse {
  0%, 100% { transform: scale(1); }
  8% { transform: scale(1.04) rotate(-1deg); }
  16% { transform: scale(1.04) rotate(1deg); }
  24% { transform: scale(1); }
}
.chat-card-note {
  color: var(--cr-gray);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  text-align: center;
}
