/* モバイル用チャットスタイル */
@media (max-width: 768px) {
  /* ページ全体をフルスクリーン表示にする */
  .chat-page-fullscreen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  .post-chat-page {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  /* モバイル用ヘッダーをコンパクトにする */
    .page-header {
        padding: 0.15rem 1rem;
        margin-bottom: 0;
        /*margin-top: 60px;*/
    }

    .header-content h1 {
        font-size: 1.2rem;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        max-width: 70%;
        margin: 0 auto;
        text-align: center;
    }
  
  .back-btn {
    font-size: 0.85rem;
  }
  
  .boya-box {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
  }
  
  /* 投稿内容をコンパクトに表示 */
  .post-summary {
    margin-bottom: 0.75rem;
    padding: 1rem;
  }
  
  .post-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .post-meta-mobile {
    font-size: 0.85rem;
  }
  
  .post-tags-mobile .tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
  
  .full-content-title {
    font-size: 1rem;
  }
  
  .full-content-text {
    font-size: 0.95rem;
    max-height: none;
    overflow: visible;
  }
  
  /* チャットコンテナをフレックスで伸縮 */
  .chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: none;
    height: auto;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    margin-bottom: 0;
    /*padding-bottom: 70px;*/ /* 下部に余白を追加 */
  }
  
  .chat-header {
    padding: 0.75rem;
  }
  
  .chat-header h2 {
    font-size: 1.1rem;
  }
  
  #mobileUserCount {
    font-size: 0.8rem;
  }
  
  .chat-main {
    flex: 1;
    min-height: 200px;
    padding: 0.75rem;
    /*padding-bottom: 60px;*/ /* ナビゲーションバーの高さに合わせる */
  }
  
  #mobileChatMessages {
    padding-bottom: 10px;
  }
  
  .chat-message {
    max-width: 90%;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.6rem;
  }
  
  .message-header {
    margin-bottom: 0.3rem;
  }
  
  .message-content {
    font-size: 0.95rem;
  }
  
  /* 入力フォームを底面に固定 */
  .chat-input-form {
    padding: 0.75rem;
  }
  
  .input-group input {
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
  }
  
  /* タッチデバイス向け調整 */
  .send-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* スワイプでの操作をスムーズにする */
  .post-chat-page {
    touch-action: pan-y;
  }
  
  /* Pull-to-refresh向けの余白 */
  .chat-main {
    -webkit-overflow-scrolling: touch;
  }
  
  /* キーボード表示時の調整 */
  @media screen and (max-height: 450px) {
    .post-summary {
      display: none;
    }
    
    .chat-container {
      border-radius: var(--card-radius);
    }
  }
}