* {
  box-sizing: border-box;
}


body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #f5f5f5;

    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  #chat {
    height: calc(100vh - 60px);
    flex: 1;
    overflow-y: auto;
    padding: 10px;
  }
  
  .msg {
    display: flex;
    margin-bottom: 10px;
  }
  
  .msg.user {
    justify-content: flex-end;
    margin-bottom: 12px;
    padding-right: 4px;
  }
  
  .user-bubble {
    background: #e9e9eb;
    color: #000;
    padding: 0.5rem 0.75rem;   /* 8px 12px */
    border-radius: 1rem;       /* 16px / 12px どちらでも自然 */
    max-width: 70%;
    line-height: 1.4;
    word-break: break-word;
  }
  
  .msg.bot {
    align-items: flex-start;
  }
  
  .bot-icon {
    width: 2rem;   /* 32px */
    height: 2rem;
    margin-right: 0.4rem;
  }  
  
  .bot-bubble {
    background: white;
    padding: 0.5rem 0.75rem;   /* 8px 12px */
    border-radius: 1rem;       /* 16px / 12px どちらでも自然 */
    max-width: 70%;
    position: relative;
  }
  
  /* thinking中の … アニメーション */
  .bot-bubble.thinking::after {
    content: "…";
    animation: dots 1.4s steps(3, end) infinite;
  }
  
  @keyframes dots {
    0%  { content: "…"; }
    33% { content: "……"; }
    66% { content: "………"; }
  }
  
  /* 入力エリア */
  form {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
  
    padding: 8px 10px;
    background: #ffffff;
  
    border-top: 1px solid #e5e5e5;
  }
  
  /* botがしゃべっている間（落ち着いたグレー） */
.form-typing #text {
    background: #f2f2f3;
    border-color: #d0d0d0;
  }
  
  #text {
    flex: 1;
  
    padding: 0.6rem 0.75rem;   /* 10px 12px */
    font-size: 1rem;           /* 14px相当 */
    border-radius: 1.25rem;    /* 20px */
    border: 1px solid #d9d9d9;
  
    background: #ffffff;
    color: #000;
  
    line-height: 1.4;
  }
  
  #text::placeholder {
    color: #999;
  }
  
  #text:focus {
    outline: none;
    border-color: #c7c7c7;
  }
  
  #text:disabled {
    background: #f2f2f3;
    border-color: #d0d0d0;
  }
  
  
  button {
    width: 2.25rem;    /* 36px */
    height: 2.25rem;
  
    border-radius: 50%;
    border: 1px solid #d9d9d9;
  
    background: #f7f7f8;
    color: #555;
  
    font-size: 1rem;
    cursor: pointer;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    transition: background 0.15s, transform 0.08s;
  }
  
  button:hover {
    background: #eeeeef;
  }
  
  button:active {
    transform: scale(0.92);
  }
  
  button:disabled {
    opacity: 0.4;
    cursor: default;
  }
  
  #header-note {
    position: sticky;      /* スクロールしても左上に残る */
    top: 0;
    z-index: 5;
  
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;   /* 12px相当 */
    color: #888;
    background: #fff;
  
    border-bottom: 1px solid #eee;
  }
  
  /* typing中だけ少し存在感を落とす（任意） */
  #header-note.typing {
    color: #aaa;
  }

  /* モバイル用の調整は一時的に削除されました（必要なら再追加します） */
  