/* =========================================================
   Chat Prototype CSS（LINE風・レスポンシブ完全版）
   mobile first / 下固定入力欄
   ========================================================= */

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* ---------- Base ---------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               "Segoe UI", Arial, "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", Meiryo, sans-serif;
  color: #222;
  background: #e5ddd5; /* LINE風 背景 */
}

/* ---------- Layout Wrapper ---------- */
.chat-prototype {
  height: 100dvh;                 /* iOS対策 */
  display: flex;
  flex-direction: column;
  background: #e5ddd5;
}

/* ---------- Header ---------- */
.chat-header {
  flex-shrink: 0;
  padding: 10px 12px;
  text-align: center;
  background: #21a464;           /* LINEヘッダー風 */
  color: #fff;
}

.chat-header h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  background: #21a464;
}

/* ---------- Chat Body ---------- */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: 88px;           /* 入力欄分 */
  background: #e5ddd5;
}

/* ---------- Message Row ---------- */
.msg {
  display: flex;
  margin-bottom: 10px;
}

.msg-left {
  justify-content: flex-start;
}

.msg-right {
  justify-content: flex-end;
}

/* ---------- Bubble ---------- */
.bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* 施設側（左） */
.msg-left .bubble {
  background: #ffffff;
  border-top-left-radius: 4px;
}

/* 保護者側（右） */
.msg-right .bubble {
  background: #dcf8c6;            /* LINE送信側グリーン */
  border-top-right-radius: 4px;
}

/* ---------- Image Bubble ---------- */
.bubble.image {
  padding: 4px;
}

.bubble.image img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* ---------- Input Area（下固定） ---------- */
.chat-input {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  background: #f0f0f0;
  border-top: 1px solid #ccc;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
}

/* ---------- Input Controls ---------- */
.chat-input button {
  flex-shrink: 0;
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
}

.chat-input button:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  height: 36px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-input textarea:focus {
  outline: none;
  border-color: #34b7f1;
}


/* Chat Prototypeページだけ「トップへ戻る」ボタンを消す */
/* 連絡ノート（試作）ページだけ 固定UIを全部止める */
body.page-id-163 #pagetop,
body.page-id-163 [id*="pagetop"],
body.page-id-163 [class*="pagetop"],
body.page-id-163 [class*="float"],
body.page-id-163 [class*="fix"],
body.page-id-163 .swl-fix-btn {
  display: none !important;
}



/* 日付区切り（LINE風） */
.chat-date {
  text-align: center;
  margin: 12px 0;
}

.chat-date span {
  display: inline-block;
  font-size: 12px;
  color: #666;
  background: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 12px;
}



/* =========================================================
   Tablet（768px〜）
   ========================================================= */
@media (min-width: 768px) {
  .chat-prototype {
    max-width: 720px;
    margin: 0 auto;
  }

  .chat-body {
    padding: 16px;
    padding-bottom: 96px;
  }

  .bubble {
    max-width: 70%;
    font-size: 15px;
  }

  .chat-input {
    max-width: 720px;
  }
}

/* =========================================================
   PC（1024px〜）
   ========================================================= */
@media (min-width: 1024px) {
  .chat-prototype {
    max-width: 860px;
  }

  .bubble {
    max-width: 65%;
    font-size: 15.5px;
  }

  .chat-input {
    max-width: 860px;
  }
}