/* チャット画面。色・角丸・フォントは js/theme.js が CSS変数で上書きする（ここは既定値） */
:root {
  --accent: #e8742a; --header-bg: #e8742a; --header-text: #fff; --header-border: transparent;
  --bg: #f4f2ee; --panel: #fff; --text: #24211d; --muted: #7a736a; --line: rgba(0,0,0,.1);
  --bot-bg: #fff; --bot-text: #24211d; --user-bg: #e8742a; --user-text: #fff;
  --chip-bg: rgba(232,116,42,.07); --chip-text: #e8742a; --chip-border: rgba(232,116,42,.6);
  --radius: 16px; --font: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif; --fs: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs); }
.app { max-width: 640px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--header-border); }
.head .logo { height: 32px; max-width: 96px; object-fit: contain; border-radius: 6px; }
.head-text { flex: 1; min-width: 0; }
.title { font-weight: 700; font-size: 1.07em; }
.subtitle { font-size: .8em; opacity: .85; }
.reset { border: 1px solid currentColor; background: transparent; color: inherit; opacity: .8; border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: inherit; }
.log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: flex-start; align-self: flex-start; max-width: 92%; }
.row .msg { max-width: 100%; }
.av { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; font-size: 19px; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.who { font-size: 11px; color: var(--muted); margin: 0 0 2px 2px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: var(--radius); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg.bot { background: var(--bot-bg); color: var(--bot-text); border: 1px solid var(--line); border-top-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--user-bg); color: var(--user-text); border-top-right-radius: 4px; align-self: flex-end; }
.msg .q { font-weight: 700; display: block; margin-bottom: 4px; }
.msg a { color: var(--accent); }
.msg.user a { color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
.with-av .chips, .with-av .label, .with-av .fb { margin-left: 42px; }
.chip { border: 1px solid var(--chip-border); color: var(--chip-text); background: var(--chip-bg); border-radius: 999px; padding: 7px 12px; font-size: .87em; cursor: pointer; text-align: left; font-family: inherit; }
.chip:hover { filter: brightness(.95); }
.chip.ghost { border-color: var(--line); color: var(--muted); background: transparent; }
.label { font-size: 12px; color: var(--muted); align-self: flex-start; margin-bottom: -6px; }
.fb { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); align-self: flex-start; }
.fb button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-family: inherit; }
.fb button[disabled] { opacity: .5; cursor: default; }
.suggest { position: absolute; left: 12px; right: 12px; bottom: 66px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.15); overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; padding: 10px 14px; font-size: .93em; cursor: pointer; font-family: inherit; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.on { background: var(--chip-bg); }
.suggest .hint { font-size: 11px; color: var(--muted); padding: 6px 14px 0; }
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 16px; background: var(--bg); color: var(--text); font-family: inherit; }
.composer button { border: 0; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 18px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
