/* liff/style.css */

body {
    font-family: 'Segoe UI', 'Meiryo', sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

.app {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    max-width: 375px;
    min-height: auto;
    margin: 0 auto 2em;
    padding: 2em;
    padding-bottom: 80px;
}

h1 {
    font-size: 1.5em;
    margin-bottom: 1em;
    text-align: center;
    padding: 5px 50px;
    background-color: #06c755;
    border-radius: 5px;
    color: rgb(253, 250, 50);
}

.personality-input label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
    color:#06c755;
}

.personality-input input {
    margin-bottom: 1em;
}

input[type="file"],
input[type="number"],
input[type="text"] {
    display: block;
    padding: 5px;
    width: 100%;
}

.messagesContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

#messagesContainer {
    margin-top: 1.5em;
}

button {
    background: #06c755;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.7em 1.2em;
    font-size: 1em;
    cursor: pointer;
    margin: auto;
    display: block;
}

button#generate-button {
    margin-bottom: 1rem;
}

.message-text {
    width: 100%;
    height: 75px;
    font-size: 16px;
}

#copyBtn:active {
    opacity: 0.8;
}

/* メッセージ操作ボタンエリア */
.message-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.action-btn {
    background: #06c755;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background: #05a649;
}

.action-btn:active {
    opacity: 0.8;
}

.copy-btn {
    background: #06c755;
}

.regenerate-btn {
    background: #4CAF50;
}

.start-over-btn {
    background: #FF9800;
}

/* レスポンシブ対応 */
@media (max-width: 375px) {
    .message-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 80%;
        margin: 5px 0;
    }
}

/* メッセージ区切り線 */
.message-separator {
    display: flex;
    align-items: center;
    margin: 30px 0;
    opacity: 0.7;
}

.separator-line {
    flex: 1;
    height: 1px;
    background-color: #ddd;
}

.separator-text {
    padding: 0 15px;
    font-size: 14px;
    color: #666;
    background-color: #f7f7f7;
    white-space: nowrap;
}

/* ローディング表示 */
.loading-message {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
}

.loading-content {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #06c755;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.question_title {
    background-color: #06c755;
    padding: 10px 20px;
    text-align: center;
    color: #fff;
    border-radius: 5px;
}

.question {
    border-bottom: 1px solid #000;
}

/* 停止ボタンコンテナ */
.cancel-button-container {
    position: fixed;
    bottom: 90px; /* 100px → 85px に変更 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
}

#cancelBtn {
    background-color: #ff6666;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.personality {
    background-color: rgb(253, 250, 50);;
    color: #000;
    border: none;
    padding: 10px;
    margin-top: 1em;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}

.run-app {
    background-color: #06c755;
    color: #fff;
    border: none;
    padding: 10px;
    margin-top: 20px;
    margin-inline: 15%;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}

.intro img {
    width: 100%;
    height: auto;
}

.chat-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  background: #f1f1f1;
  border-radius: 9999px;
  width: 320px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  padding: 5px 10px;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.chat-buttons {
  display: flex;
  gap: 6px;
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 6px 10px;
  border-radius: 9999px;
  background: white;
  margin: 0 6px;
  font-size: 14px;
}

.send-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #00c084;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.send-icon {
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* コピー成功メッセージのアニメーション */
@keyframes copyFadeInOut {
  0% { 
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  20% { 
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% { 
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% { 
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

.cancel-button {
  margin-left: 10px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background-color: #ddd;
  cursor: pointer;
  font-size: 14px;
}

.photopreview {
    position: relative;
}

#check_personality {
    margin-top: 1rem;
}

.confirm-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.confirm-buttons button {
    background-color: #00c853;
    color: white;
    font-size: 1.2em;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 10px;
}

/* === 吹き出しチャットスタイル === */
.chat-conversation {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
  padding: 0 10px;
  max-width: 100%;
  min-height: 60px;
}

/* アプリからのメッセージ（相手の吹き出し） */
.chat-bubble-app {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin-bottom: 10px;
}

.chat-bubble-app .bubble-content {
  background-color: white;
  color: #333;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-width: 80%;
  position: relative;
  font-size: 16px;
  line-height: 1.4;
}

/* ユーザーからのメッセージ（自分の吹き出し） */
.chat-bubble-user {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 10px;
}

.chat-bubble-user .bubble-content {
  background-color: #06c755;
  color: white;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  max-width: 80%;
  position: relative;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 吹き出しの三角形（しっぽ）- アプリ側 */
.chat-bubble-app .bubble-content::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-right-color: white;
  border-bottom: 0;
  border-left: 0;
  margin-bottom: -6px;
}

/* 吹き出しの三角形（しっぽ）- ユーザー側 */
.chat-bubble-user .bubble-content::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: -5px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-left-color: #06c755;
  border-bottom: 0;
  border-right: 0;
  margin-bottom: 0px;
}

/* 画像表示専用スタイル - 吹き出しなしバージョン */
.chat-bubble-image {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 10px;
}

.chat-bubble-image .bubble-content {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  position: relative;
  max-width: 200px;
}

/* 吹き出しの三角形を非表示 */
.chat-bubble-image .bubble-content::before {
  display: none !important;
}

.bubble-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.bubble-image img {
  border-radius: 8px;
  max-width: 180px;
  height: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 画像削除ボタンのホバー効果 */
.bubble-image button:hover {
  background-color: #ff4444 !important;
  transform: scale(1.1);
}

/* チャット履歴エリア */
#chat-history {
  margin: 20px 0 30px 0;
  padding: 10px;
  border-radius: 8px;
  /*background-color: #fafafa;
  max-height: calc(100vh - 300px);
  min-height: 60px;
  overflow-y: auto;
  position: relative;*/
}

/* レスポンシブ対応 */
@media (max-width: 375px) {
  .chat-bubble-app .bubble-content,
  .chat-bubble-user .bubble-content {
    max-width: 85%;
    font-size: 16px;
  }
  
  .chat-conversation {
    padding: 0 5px;
  }
  
  .bubble-image img {
    max-width: 150px;
  }
  
  /* チャット履歴エリアをモバイル向けに調整 */
  /*#chat-history {
    max-height: calc(100vh - 250px);
  }*/
}

/* より大きな画面の場合 */
@media (min-width: 376px) and (max-width: 768px) {
  /*#chat-history {
    max-height: calc(100vh - 280px);
  }*/
}

/* デスクトップの場合 */
@media (min-width: 769px) {
  /*#chat-history {
    max-height: calc(100vh - 320px);
  }*/
}

/* ===== 選択肢ボタンのスタイル ===== */
.choice-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 15px 0;
    padding: 0 20px;
}

.choice-btn {
    padding: 12px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.primary-btn {
    background: #06c755;
    color: white;
    box-shadow: 0 2px 8px rgba(6, 199, 85, 0.3);
}

.primary-btn:hover {
    background: #05b84d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.4);
}

.secondary-btn {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.secondary-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.choice-btn:active {
    transform: translateY(0);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .choice-buttons {
        flex-direction: row;
        gap: 10px;
    }
    
    .choice-btn {
        width: 100%;
        min-width: auto;
    }
}

/* カスタムモーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 300px;
    width: 80%;
}

.modal-text {
    font-size: 16px;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 10px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.modal-yes {
    background: #06c755;
    color: white;
}

.modal-yes:hover {
    background: #05a649;
}

.modal-no {
    background: #e0e0e0;
    color: #333;
}

.modal-no:hover {
    background: #d0d0d0;
}

/* ===== ステップUI（カテゴリー/シーン） ===== */
.step-ui {
  width: 100%;
  max-width: 375px;
  padding: 0 10px;
  margin: 8px 0 12px;
}

/* セレクトボックスの見た目を統一 */
.select-box {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  font-size: 16px;
  color: #333;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  outline: none;
  transition: box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.select-box:focus {
  border-color: #06c755;
  box-shadow: 0 0 0 3px rgba(6,199,85,0.15);
}

.select-box:disabled {
  background: #f2f2f2;
  color: #999;
  cursor: not-allowed;
}

/* セレクト下の余白（固定フッター入力と干渉しないように） */
#step2, #step3 {
  margin-bottom: 6px;
}

/* チャット履歴とステップUIの間の余白微調整 */
#chat-history {
  margin-bottom: 14px;
}

/* 画像追加ボタンは当面使わないため非表示（将来復活可） */
#addPhotoButton {
  display: none;
}

/* 小さめ端末でセレクトのタップ余白を確保 */
@media (max-width: 375px) {
  .select-box {
    font-size: 16px;
    height: 44px;
  }
}

/* 吹き出し内のUIを揃える */
.bubble-controls select.select-box {
  margin-top: 8px;
  width: 100%;
}

/* ====== Brand tokens (Warm UI) ====== */
:root{
  --brand:#1db954;          /* LINE連想の緑 */
  --brand-d:#119a44;
  --accent:#ffe86a;         /* やわらかい黄色 */
  --ink:#1a1a1a;
  --muted:#666;
  --ring:#e9e9e9;
  --shadow:0 10px 30px rgba(0,0,0,.08);
  --radius:22px;
}

/* ====== Title: pill style ====== */
/* 既存 h1 を壊さないため、classを付けた箇所だけ新デザインに */
h1.title-pill{
  font-size: 1.4em;
  margin: 0 0 .9em;
  text-align: center;
  display:inline-block;
  padding:10px 18px;
  background: var(--brand);
  color:#fff;               /* 可読性UP */
  border-radius:999px;      /* まるいピル */
  box-shadow: var(--shadow);
  letter-spacing:.02em;
}

/* ====== Buttons: 統一デザイン ====== */
.btn{
  display:block;
  text-align:center;
  text-decoration:none;
  padding:14px 16px;
  border:none;
  border-radius: var(--radius);
  font-weight: 800;
  cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--brand);
  color:#fff;
}
.btn-primary:hover{ background: var(--brand-d); }

.btn-accent{
  background: var(--accent);
  color:#333;
}

.btn-secondary{
  background:#efefef;
  color:#222;
}

/* 既存クラス → 新ボタンに“なりすまし” */
.personality{ 
  background: var(--accent);
  color:#333;
  border:none;
  padding:14px 16px;
  margin-top: 1em;
  border-radius: var(--radius);
  cursor:pointer; text-align:center;
  font-weight:800;
  box-shadow: var(--shadow);
}
.run-app{
  background: var(--brand);
  color:#fff;
  border:none;
  padding:14px 16px;
  margin-top:20px; margin-inline:15%;
  border-radius: var(--radius);
  cursor:pointer; text-align:center;
  font-weight:800;
  box-shadow: var(--shadow);
}

/* ====== Popup(Modal) 改善 ====== */
.modal-overlay, .modal-backdrop{
  /* 既存定義があってもOK。どちらにも効くように両方指定 */
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none; align-items:center; justify-content:center;
  z-index: 1000;
}
.modal-content, .modal{
  background:#fff; border:1px solid var(--ring);
  border-radius: 16px; padding: 20px; width:92%; max-width:520px;
  box-shadow: var(--shadow);
}
.modal h3{ margin:0 0 10px; font-size:18px }
.modal p, .modal-text{ margin:6px 0 12px; line-height:1.8; color:#333 }

.modal-buttons, .modal-actions{
  display:flex; gap:8px; flex-wrap:wrap; margin-top:10px;
}
.modal-btn, .modal .btn{ flex:1; }
.modal-yes{ background: var(--brand); color:#fff; border:none; }
.modal-yes:hover{ background: var(--brand-d); }
.modal-no{ background:#efefef; color:#222; border:none; }

@media (max-width: 420px){
  .modal-buttons, .modal-actions{ flex-direction: column; }
}

/* ====== Optional: 淡い背景に合わせた調整（任意） ====== */
.app{ max-width: 375px; }

/* モーダルのボタンレイアウトを2段に */
.modal-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}
.modal-row{
  display:flex;
  gap:8px;
}
.modal-row .btn{ flex:1; }      /* 上段2ボタンを等幅に */
.btn-cancel{ width:100%; }      /* 下段キャンセルをフル幅に */

/* 画面が狭い時も見やすく */
@media (max-width: 420px){
  .modal-row{ flex-direction:row; }  /* 上段は横並びのまま */
  .btn-cancel{ width:100%; }
}

#chat-history.hidden {
    display: none;
}

/* ====== ユーザー情報セクション ====== */
.user-info-section {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user-info-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.radio-item, .checkbox-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.radio-item:hover, .checkbox-item:hover {
    background: #f0f0f0;
    border-color: var(--brand);
}

.radio-item.selected, .checkbox-item.selected {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.radio-item input, .checkbox-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
}

input[type="text"].other-input {
    width: 94%;
    margin-top: 10px;
    /*padding: 10px;*/
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    transition: border-color 0.2s;
}

input[type="text"].other-input:focus {
    outline: none;
    border-color: var(--brand);
}

input[type="text"].other-input.show {
    display: block;
}

/* 区切り線 */
.section-divider {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 30px 0;
}

/* 確認画面のユーザー情報表示 */
.user-info-confirmation {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    line-height: 1;
}

.user-info-confirmation h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
    margin-top: 0px;
}

.user-info-confirmation p {
    margin: 5px 0;
    color: #555;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 375px) {
    .radio-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }
    
    .checkbox-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }
    
    /* 年代は3列 */
    #ageGroup {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 家族構成は2列 */
    #familyGroup {
        grid-template-columns: 1fr 1fr;
    }
    
    .radio-item, .checkbox-item {
        text-align: center;
        padding: 5px 8px;
        font-size: 12px;
    }
}

/* 編集・メッセージ生成ボタンのスタイル統一 */
#edit-button, #generate-button {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    margin: 0 5px;
}

#edit-button {
    background: #f0f0f0;
    color: #333;
}

#edit-button:hover {
    background: #e0e0e0;
}

#generate-button:hover {
    background: var(--brand-d);
    transform: translateY(-1px);
}

/* ボタンの表示を改善 */
.confirmation-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

@media (max-width: 375px) {
    .confirmation-buttons {
        flex-direction: column;
    }
    
    #edit-button, #generate-button {
        width: 100%;
        margin: 5px 0;
    }
}

/* 編集ボタンを黄色に */
#edit-button, .btn-accent {
    background: var(--accent) !important;
    color: #333 !important;
    border: none;
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

#edit-button:hover, .btn-accent:hover {
    background: #f0d85a !important;
    transform: translateY(-1px);
}

.settings-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 24px;
    color: #666;
    padding: 0;
}

.settings-button:hover {
    background: #f8f8f8;
}

.settings-button .dots {
    transform: rotate(90deg);
}

.settings-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.settings-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}

.settings-menu a:hover {
    background: #f8f8f8;
}

/* 既存のボタンスタイルを活用して、セカンダリボタンを定義 */
#skip_registration {
   /* background: #f0f0f0;
    color: #333;:*/
    margin-top: 10px;
    background: var(--brand);
    color: #fff;
}

#skip_registration:hover {
    /*background: #e0e0e0;*/
    background: var(--brand-d);
}

.personality-input .form-group {
    margin-top: 15px;
}

.personality-input .form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.personality-input .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.personality-input .radio-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: normal;
}

.personality-input .radio-item:hover {
    background: #e8f4fd;
    border-color: #1db954;
}

.personality-input .radio-item input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.personality-input .radio-item input[type="radio"]:checked + {
    background: #e8f4fd;
    border-color: #1db954;
    font-weight: 600;
}

/* 選択されたラジオボタンの親要素のスタイル */
.personality-input .radio-item:has(input[type="radio"]:checked) {
    background: #e8f4fd;
    border-color: #1db954;
    font-weight: 600;
}

/* インライン入力欄のスタイル */
.chat-input-inline {
  padding: 0 10px;
  margin-top: 15px;
  width: 100%;
  max-width: 355px; /* .appの最大幅375pxから左右パディング10pxずつを引いた値 */
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  background: #f1f1f1;
  border-radius: 9999px;
  padding: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-input-inline .chat-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 6px 15px;
  border-radius: 9999px;
  background: white;
  margin: 0 6px;
  font-size: 14px;
}

.chat-input-inline .send-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.chat-input-inline .send-button:hover {
  transform: scale(1.05);
}

.chat-input-inline .send-button:active {
  transform: scale(0.95);
}

/* ステップ3表示時は固定入力欄を非表示に */
#step3.step-ui ~ #chatInputContainer {
  display: none !important;
}

/* ===== スマホ自動ズーム防止の修正 ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select,
.form-control,
.chat-input {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
}

/* フォーカス時のズーム防止 */
@media (max-width: 768px) {
    /* テキスト入力系のみに適用 */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    textarea, 
    select {
        font-size: 16px !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* ラジオボタンとチェックボックスは16pxのみ設定 */
    input[type="radio"],
    input[type="checkbox"] {
        font-size: 16px !important;
        /* appearance は設定しない */
    }
    
    /* 特に.chat-inputクラスに対して明示的に設定 */
    .chat-input {
        font-size: 16px !important;
    }
}

/* ===== メッセージ選択ラジオボタンの表示修正 ===== */
/* メッセージフォーム内のラジオボタンを強制的に表示 */
.messageForm input[type="radio"][name="messageSelect"] {
    /* 表示を強制 */
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    
    /* サイズを明確に指定 */
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 5px 10px 5px 0 !important;
    
    /* スタイルをリセット */
    transform: none !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    
    /* ネイティブのラジオボタン外観を維持 */
    -webkit-appearance: radio !important;
    -moz-appearance: radio !important;
    appearance: radio !important;
}

/* メッセージアイテムのレイアウト調整 */
.message-item {
    display: flex !important;
    align-items: flex-start !important;
    margin-bottom: 15px !important;
    padding: 10px !important;
    /*border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;*/
}

/* ラベルとテキストエリアのレイアウト */
.message-item label {
    display: block !important;
    flex: 1 !important;
}

/* 選択されたメッセージのハイライト */
/*.message-item:has(input[type="radio"]:checked) {
    background-color: #f0f8ff !important;
    border-color: #06c755 !important;
}*/

/* スマホでも確実に表示 */
@media (max-width: 768px) {
    .messageForm input[type="radio"][name="messageSelect"] {
        /* タッチターゲットを大きく */
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
    }
}

/* キャンセルメッセージのスタイル */
.cancel-message {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin: 20px auto;
  max-width: 600px;
  text-align: center;
  animation: fadeIn 0.3s ease-in;
}

.cancel-message p {
  margin: 0 0 20px 0;
  color: #6c757d;
  font-size: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
