
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.chat-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to right, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: white;
  z-index: 1000;
}
.chat-title {
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  flex: 1;
}
.chat-actions button,
.back-button {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  margin-left: 8px;
}
.chat-container {
  margin-top: 60px;
  -webkit-backface-visibility: hidden;
}
.chat-messages {
  padding: 20px 12px 100px;
}
.chat-input-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: 22px 10px;
  display: flex;
  align-items: center;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.1);
  z-index: 999;
}
.chat-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 17px;
  border-radius: 24px;
  border: 1px solid #ccc;
  margin-right: 10px;
}
.send-button {
  background: linear-gradient(to right, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
}
.message {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}
.message.user {
  align-items: flex-end;
}
.message.character {
  align-items: flex-start;
}
.message-content {
  max-width: 80%;
  background: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: 15px;
}
/* Android専用 */
@media screen and (max-width: 768px) {
  html.android .chat-input-container {
    position: absolute !important;
    bottom: 0 !important;
    padding: 22px 10px !important;
  }
}
/* ミントブルー：ユーザーの吹き出し */
.message.user .message-content {
  background-color: #e0f7ff;
  color: #333;
}

/* === quick-fix: shared header nav === */
.site-header { border-bottom: 1px solid #eee; }
.nav { display:flex; gap:1rem; padding:12px 16px; flex-wrap:wrap; }
.nav a { text-decoration:none; }
@media (max-width: 480px) { .nav { gap:.75rem; font-size:14px; } }


/* ===================================================================
   CSS整理（第二弾） 2025-08-08
   - 影響を最小化するため、既存クラス名は変更せず、共通ベースとユーティリティを追加
   - 必要に応じて各ページで上書き可能
=================================================================== */

/* === 1) ベース：リセット/タイポグラフィ ========================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.7;
  color: #222;
  background: #fff;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 0 0 .6em; }
p { margin: 0 0 1em; }

/* === 2) レイアウトコンテナ ===================================== */
.container { max-width: 1080px; margin: 0 auto; padding: 16px; }
.section { padding: 24px 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 768px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

/* === 3) コンポーネント ========================================= */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f8f8f8;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #f1f1f1; }
.card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.muted { color: #666; font-size: .95em; }

/* === 4) ナビ（第一弾の追補） =================================== */
.site-header { position: sticky; top: 0; background: #fff; z-index: 10; }
.nav a { padding: 6px 8px; border-radius: 6px; }
.nav a:focus, .nav a:hover { background: #f5f5f5; }

/* === 5) レスポンシブ微調整 ===================================== */
@media (max-width: 480px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.2rem; }
  .section { padding: 16px 12px; }
}

/* === 6) ユーティリティ ========================================= */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 12px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 12px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.text-center { text-align: center !important; }
.w-100 { width: 100% !important; }
.max-w-640 { max-width: 640px; }
/* =================================================================== */
