:root { --bg:#f6f7fb; --card:#ffffff; --muted:#6b7280; --ai:#e5e7eb; --me:#d1fae5; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; background: var(--bg); }
#app { max-width: 720px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 16px; padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,.06); }
.card h1 { margin-top: 0; font-size: 1.25rem; }
label { display:block; font-size: .9rem; margin-top: 12px; color:#111827; }
input { width: 100%; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 12px; font-size: 1rem; }
button { margin-top: 16px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; background: #111827; color: #fff; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .6; cursor: not-allowed; }
.muted { color: var(--muted); font-size: .9rem; }
.hidden { display:none; }

.chat-header { position: sticky; top: 0; background: #111827; color:#fff; padding: 12px 16px; border-radius: 12px 12px 0 0; font-weight: 700; }
.messages { background: var(--card); padding: 12px; height: 70vh; overflow: auto; border-left: 1px solid #eee; border-right: 1px solid #eee; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 16px; margin: 8px 0; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.bubble.ai { background: var(--ai); border-bottom-left-radius: 4px; margin-right: auto; }
.bubble.me { background: var(--me); border-bottom-right-radius: 4px; margin-left: auto; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; background: var(--card); padding: 8px; border-radius: 0 0 12px 12px; border: 1px solid #eee; border-top: none; }
.composer textarea {
  border-radius: 10px;
  min-height: 40px;         /* 1行ぶんの最小高さ */
  max-height: 200px;        /* 伸びる上限（お好みで 40vh 等に） */
  padding: 10px 12px;
  line-height: 1.5;
  font-size: 1rem;
  resize: none;             /* ユーザーのドラッグリサイズを無効化 */
  overflow: auto;           /* 上限を超えたら内部スクロール */
}
.composer button { margin: 0; padding: 10px 16px; }
.composer { align-items: end; }
.composer textarea:focus { outline: 2px solid #cbd5e1; }

.typing { font-size: .85rem; color: var(--muted); margin: 6px 0 0 6px; }
/* --- Logout button: small & fixed at top-right --- */
#logout-btn.logout{
  position: fixed;
  top: 10px;               /* 重なれば 14〜18px に調整 */
  right: 10px;
  z-index: 1000;
  width: auto !important;  /* 全幅ボタン指定を打ち消す */
  margin: 0 !important;
  padding: 6px 10px;       /* 小さめ */
  font-size: 12px;         /* だいたい今の1/4〜1/3の見た目 */
  line-height: 1;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

@media (max-width: 480px){
  #logout-btn.logout{
    top: 8px; right: 8px;
    font-size: 11px;
    padding: 5px 9px;
  }
}

#nameplate.nameplate{
  position: fixed;
  top: 10px;        /* 重なれば 14〜18px に微調整 */
  left: 10px;
  z-index: 1000;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

