/* ============================================================
   chat-look.css — AI返信を「本物のチャット」の見た目にする（2026-11-12 USER「motion-chat のような、このくらいリアルなチャットの感じを AI返信に」）
   お手本：Desktop\GPT作UI\motion-chat（ChatGPT Astra 作）。色・角の丸み・吹き出し・翻訳の出し方・入力中の点・新着の出方を合わせた
   ・テスト版だけ。<html class="mc"> のときだけ効く（?chat=0 で開くと今までの見た目）
   ・仕組み（候補を選んで送る・直す・自分で書く・送らない）は変えていない。見た目と動きだけ
   ============================================================ */
.mc .aichat {
  --mc-bg: #fff; --mc-pane: #fafbfc; --mc-text: #293340; --mc-muted: #6e7b88; --mc-line: #e9edf0;
  --mc-accent: #527a6a; --mc-soft: #eef4f0; --mc-bubble: #f0f3f5; --mc-out: #eaf3ed;
  display: grid; grid-template-columns: 300px 1fr; gap: 0; min-height: 72vh;
  background: var(--mc-bg); color: var(--mc-text); border: 1px solid var(--mc-line); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(35, 52, 44, .07); overflow: hidden;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]).mc .aichat { --mc-bg: #182127; --mc-pane: #151d22; --mc-text: #e1e9ee; --mc-muted: #96a6b1; --mc-line: #2a363e; --mc-accent: #a5ceba; --mc-soft: #24372f; --mc-bubble: #26323b; --mc-out: #293f36; } }
:root[data-theme="dark"].mc .aichat { --mc-bg: #182127; --mc-pane: #151d22; --mc-text: #e1e9ee; --mc-muted: #96a6b1; --mc-line: #2a363e; --mc-accent: #a5ceba; --mc-soft: #24372f; --mc-bubble: #26323b; --mc-out: #293f36; }

/* ---- 左：会話の一覧 ---- */
.mc .aichat-list { border: 0; border-right: 1px solid var(--mc-line); border-radius: 0; background: var(--mc-pane); max-height: calc(100vh - 190px); padding: 0 10px 10px; }   /* 2026-11-28：画面の下にはみ出さない高さ（一覧の最後まで見える） */
.mc .mc-listhead { position: sticky; top: 0; z-index: 2; background: var(--mc-pane); padding: 18px 8px 10px; }
.mc .mc-listhead h3 { margin: 0 0 12px; font-size: 19px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; color: var(--mc-text); }
.mc .mc-listhead h3 small { font-size: 11px; font-weight: 700; color: var(--mc-accent); background: var(--mc-soft); border-radius: 999px; padding: 1px 8px; }
.mc .mc-search { width: 100%; box-sizing: border-box; border: 1px solid var(--mc-line); border-radius: 11px; padding: 10px 12px 10px 34px; background: var(--mc-bg) no-repeat 11px 50% / 15px; color: var(--mc-text); font-size: 13px; outline: none; transition: border-color .25s, box-shadow .25s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7b88' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.mc .mc-search:focus { border-color: #9fb8a9; box-shadow: 0 0 0 3px rgba(114, 152, 129, .12); }
.mc .mc-filters { display: flex; gap: 4px; margin-top: 10px; }
.mc .mc-filters button { border: 0; background: transparent; color: var(--mc-muted); font-size: 12px; padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: background .25s, color .25s; }
.mc .mc-filters button.on { background: var(--mc-soft); color: var(--mc-accent); font-weight: 700; }

.mc .aichat-item { display: flex; align-items: flex-start; gap: 12px; position: relative; padding: 12px 12px; margin: 4px 0; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--mc-text);
  transition: background .25s, box-shadow .25s, border-color .25s, transform .2s; }
.mc .aichat-item:hover { background: var(--mc-bg); }
.mc .aichat-item:active { transform: scale(.985); }
.mc .aichat-item.on { background: var(--mc-bg); border-color: var(--mc-line); box-shadow: 0 6px 18px rgba(35, 52, 44, .06); }
/* 2026-11-13 USER「開いた時に、左の友だち欄で名前が消える」：前の見た目（admin.css）は開いた会話を紺の地に白い字にしていた。
   この見た目では地が白なので、字も白のまま＝名前と最後の文が見えなかった。字の色をこの見た目の色に戻す */
.mc .aichat-item.on, .mc .aichat-item.on b, .mc .aichat-item.on .aichat-item-h b { color: var(--mc-text); }
.mc .aichat-item.on .aichat-last, .mc .aichat-item.on .aichat-time { color: var(--mc-muted); opacity: 1; }
.mc .aichat-item.on.unread b, .mc .aichat-item.on.unread .aichat-last { color: var(--crit, #c0392b); }
.mc .aichat-item.on::before { content: ''; position: absolute; left: -10px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mc-accent); }
.mc .aichat-item .chicon { display: none; }
.mc .mc-av { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 14px; font-size: 15px; font-weight: 700; color: #4c7663; background: #deece3; }
.mc .mc-av.c1 { background: #e0edf6; color: #507a9c; } .mc .mc-av.c2 { background: #f6e8de; color: #ab7f60; } .mc .mc-av.c3 { background: #e9e5f6; color: #8471b3; }
.mc .mc-av .mc-ch { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--mc-pane); }
.mc .mc-av .mc-ch.wa { background: #25D366; } .mc .mc-av .mc-ch.tg { background: #2AABEE; } .mc .mc-av .mc-ch.jps { background: #e6527a; }
.mc .aichat-item-body { flex: 1; min-width: 0; }
.mc .aichat-item-h b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc .aichat-time { margin-left: auto; font-size: 11px; color: var(--mc-muted); }
.mc .aichat-last { display: block; font-size: 12.5px; color: var(--mc-muted); margin-top: 3px; }
.mc .aichat-chname { display: inline; background: none !important; color: var(--mc-muted) !important; font-size: 11px; padding: 0; margin-right: 6px; border: 0; }
.mc .aichat-item .aichat-chname { display: none; }
.mc .mc-sub { display: block; font-size: 11px; color: var(--mc-muted); margin-top: 4px; }
.mc .aichat-pend { position: absolute; right: 12px; bottom: 12px; background: var(--mc-accent); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 1px 7px; animation: mc-pop .4s cubic-bezier(.2, 1.8, .4, 1); }
.mc .aichat-item.unread b { font-weight: 800; }
.mc .aichat-item.mc-hide { display: none !important; }   /* 2026-11-29 USER「すべて・返事待ち・対応済み これ使えない」：admin.css の .aichat-item { display:flex !important } に負けて、絞り込み・検索で隠れなかった */

/* ---- 右：会話 ---- */
.mc .aichat-room { border: 0; border-radius: 0; background: var(--mc-bg); }
.mc .aichat-head { display: flex; align-items: center; gap: 12px; padding: 18px 26px; min-height: 76px; box-sizing: border-box; background: var(--mc-bg); color: var(--mc-text); border-bottom: 1px solid var(--mc-line); }
.mc .aichat-head .chicon { display: none; }
.mc .aichat-head > b { font-size: 16px; font-weight: 800; }
.mc .aichat-head .mc-headtext { display: flex; flex-direction: column; gap: 2px; }
.mc .aichat-head .mc-headtext small { font-size: 11px; color: var(--mc-muted); }
.mc .mc-trans { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--mc-muted); font-size: 11px; cursor: pointer; padding: 4px; }
.mc .mc-trans .sw { width: 30px; height: 18px; border-radius: 999px; background: #cbd2da; position: relative; transition: background .3s; }
.mc .mc-trans .sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .4s cubic-bezier(.34, 1.4, .64, 1); }
.mc .mc-trans[aria-pressed="true"] .sw { background: #6d927d; }
.mc .mc-trans[aria-pressed="true"] .sw::after { transform: translateX(12px); }

.mc .aichat-msgs { background: var(--mc-bg); padding: 22px 28px; max-height: 52vh; scroll-behavior: auto; }   /* 2026-11-13：smooth だと開くたびに一番上から動き出し、途中で止まっていた（USER「一番上からスタートしてしまう」） */
.mc .lrow { margin: 0 0 16px; align-items: flex-end; gap: 10px; }
.mc .lrow.l::before { content: attr(data-ini); display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #4c7663; background: #deece3; }
.mc .lrow.l.mc-cont::before { visibility: hidden; }
.mc .lb { max-width: min(72%, 560px); padding: 13px 16px; font-size: 14px; line-height: 1.8; color: var(--mc-text); word-break: break-word; box-shadow: none; }
.mc .lrow.l .lb { background: var(--mc-bubble); border-radius: 15px 15px 15px 4px; }
.mc .lrow.r .lb { background: var(--mc-out); border-radius: 15px 15px 4px 15px; }
.mc .lja { border-top: 1px solid rgba(141, 158, 152, .2); margin-top: 10px; padding-top: 9px; color: var(--mc-muted); font-size: 12.5px; line-height: 1.8; display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s cubic-bezier(.22, 1, .36, 1), opacity .35s, margin .35s, padding .35s; }
.mc .lja::before { content: '日本語'; display: block; font-size: 10px; color: var(--mc-accent); letter-spacing: .06em; margin-bottom: 2px; font-weight: 700; }
.mc .mc-hideja .lja { grid-template-rows: 0fr; opacity: 0; margin-top: 0; padding-top: 0; border-top-color: transparent; overflow: hidden; }
.mc .mc-hideja .lja::before { display: none; }
.mc .lrow.mc-new { animation: mc-enter .45s cubic-bezier(.22, 1, .36, 1) both; }

/* AIが考え中：3つの点が跳ねる */
.mc .aichat-thinking { display: flex; align-items: center; gap: 10px; color: var(--mc-muted) !important; font-size: 12px; padding: 4px 28px 14px !important; animation: mc-enter .3s ease-out; }
.mc .mc-dots { display: inline-flex; gap: 4px; background: var(--mc-bubble); padding: 13px 17px; border-radius: 13px; }
.mc .mc-dots i { width: 6px; height: 6px; background: #95a79d; border-radius: 50%; animation: mc-dots 1.1s ease-in-out infinite; }
.mc .mc-dots i:nth-child(2) { animation-delay: .14s; } .mc .mc-dots i:nth-child(3) { animation-delay: .28s; }

/* 送った返事の状態（送信済み など） */
.mc .aichat-hist { background: var(--mc-bg); border-top: 1px solid var(--mc-line); padding: 8px 28px; }
.mc .aichat-hist .note { font-size: 11px; color: var(--mc-muted); }

/* ---- 下：返事の候補（お手本の入力欄の形） ---- */
.mc .aichat-cand { background: var(--mc-bg); border-top: 1px solid var(--mc-line); padding: 16px 26px 20px; }
.mc .aichat-cand > .note:first-child { font-size: 12px; color: var(--mc-muted); display: flex; align-items: center; gap: 6px; }
.mc .aichat-cand > .note:first-child b { color: var(--mc-accent); }
.mc .aichat-opts { gap: 8px; margin: 10px 0 12px; }
.mc .aichat-opt { border: 1px solid var(--mc-line); background: var(--mc-pane); border-radius: 12px; padding: 12px 14px; transition: border-color .25s, box-shadow .25s, background .25s, transform .2s; }
.mc .aichat-opt:hover { border-color: #b9cbbf; }
.mc .aichat-opt:active { transform: scale(.995); }
.mc .aichat-opt.on { border-color: #9fb8a9; background: var(--mc-soft); box-shadow: 0 0 0 3px rgba(114, 152, 129, .12); }
.mc .aichat-opt input { accent-color: var(--mc-accent); }
.mc .aichat-opt-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--mc-bg); color: var(--mc-accent); font-size: 11px; font-weight: 800; border: 1px solid var(--mc-line); }
.mc .aichat-opt-ja { color: var(--mc-text); line-height: 1.7; }
.mc .aichat-opt-src { display: block; margin-top: 6px; color: var(--mc-muted); font-size: 12px; line-height: 1.6; }
.mc .aichat-cand textarea { border: 1px solid var(--mc-line); border-radius: 12px; background: var(--mc-pane); color: var(--mc-text); padding: 12px 14px; line-height: 1.8; transition: border-color .25s, box-shadow .25s; }
.mc .aichat-cand textarea:focus { outline: none; border-color: #9fb8a9; box-shadow: 0 0 0 3px rgba(114, 152, 129, .12); }
.mc .aichat-btns { align-items: center; }
.mc .aichat-btns .btn { border-radius: 10px; padding: 10px 16px; font-size: 13px; }
.mc .aichat-btns #aiOk { background: var(--mc-accent); color: #fff; padding: 11px 20px; box-shadow: 0 6px 16px rgba(82, 122, 106, .25); }
.mc .aichat-btns #aiOk::after { content: ' ➤'; font-size: 12px; }
.mc .aichat-btns .btn.ghost { background: transparent; border: 1px solid var(--mc-line); color: var(--mc-muted); }
.mc .aichat-room > .note, .mc .aichat-room > p.note { color: var(--mc-muted); padding: 14px 28px !important; }
.mc .aichat-room .placeholder { margin: auto; color: var(--mc-muted); }

@keyframes mc-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mc-dots { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-4px); opacity: 1; } }
@keyframes mc-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* スマホ：一覧と会話を切り替える（お手本と同じ） */
@media (max-width: 760px) {
  .mc .aichat { grid-template-columns: 1fr; border-radius: 14px; }
  .mc .aichat.mc-open .aichat-list { display: none; }
  .mc .aichat:not(.mc-open) .aichat-room { display: none; }
  .mc .mc-back { display: grid !important; }
  .mc .aichat-head { padding: 14px 16px; }
  .mc .aichat-msgs { padding: 16px; max-height: 58vh; }
  .mc .aichat-cand { padding: 12px 14px 16px; }
  .mc .lb { max-width: 84%; font-size: 13.5px; }
}
.mc .mc-back { display: none; place-items: center; width: 32px; height: 32px; border: 1px solid var(--mc-line); border-radius: 10px; background: var(--mc-bg); color: var(--mc-text); cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .mc .aichat *, .mc .aichat *::before, .mc .aichat *::after { animation: none !important; transition: none !important; } }

/* 吹き出しに元の枠線が残らないように */
.mc .lb { border: 0 !important; }


/* 時刻と入力欄（お手本の見た目に合わせる・2026-11-12） */
.mc .lrow { row-gap: 4px; }
.mc .lt { color: var(--mc-muted); font-size: 10.5px; }
.mc .lrow.l .lt { padding-left: 38px; }
.mc .lt-reply { color: var(--mc-accent); }
.mc .aichat-compose { background: var(--mc-bg); border-top: 1px solid var(--mc-line); padding: 14px 26px 18px; }
.mc .aichat-compose textarea { border: 1px solid var(--mc-line); border-radius: 12px; background: var(--mc-pane); color: var(--mc-text); line-height: 1.8; padding: 12px 14px; transition: border-color .25s, box-shadow .25s; }
.mc .aichat-compose textarea:focus { outline: none; border-color: #9fb8a9; box-shadow: 0 0 0 3px rgba(114, 152, 129, .12); }
.mc .aichat-compose #aiFreeSend { background: var(--mc-accent); color: #fff; border-radius: 10px; padding: 11px 18px; box-shadow: 0 6px 16px rgba(82, 122, 106, .25); }
.mc .aichat-compose #aiFreeSend::after { content: ' ➤'; font-size: 12px; }
@media (max-width: 760px) { .mc .aichat-compose { padding: 10px 12px 14px; } }

/* 2026-11-29 JPS予約（友達欄の切り替え「JPS予約」。USER「友達欄にJPS予約って作って切り替えれるように」「わかりやすくはしといて」）
   色は AI返信の見た目（.mc .aichat の色）と、一覧のアプリの印（.mc-ch.jps）と同じ #e6527a。明 / 暗の切り替えにも合わせる */
.aichat { --jps: #e6527a; --jps-soft: #fdeef2; --jps-text: #b0405f; --jps-wait: #fbf3e4; --jps-wait-text: #946a2c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aichat { --jps-soft: #3a2630; --jps-text: #f2a3b8; --jps-wait: #3a3222; --jps-wait-text: #e2c48c; } }
:root[data-theme="dark"] .aichat { --jps-soft: #3a2630; --jps-text: #f2a3b8; --jps-wait: #3a3222; --jps-wait-text: #e2c48c; }
.jps-logo { display: inline-block; background: var(--jps, #e6527a); color: #fff; font-weight: 800; font-size: 10.5px; letter-spacing: .06em; border-radius: 6px; padding: 2px 7px; }
/* 切り替えのボタン：4つ並ぶので折り返せるように。JPS予約はピンクの数で目立たせる */
.mc .mc-filters { flex-wrap: wrap; }
.mc .mc-filters button.mc-f-jps { color: var(--jps-text); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.mc .mc-filters button.mc-f-jps i { font-style: normal; font-size: 10.5px; min-width: 16px; box-sizing: border-box; text-align: center; color: #fff; background: var(--jps); border-radius: 999px; padding: 1px 5px; }
.mc .mc-filters button.mc-f-jps i:empty { display: none; }
.mc .mc-filters button.mc-f-jps.on { background: var(--jps-soft); color: var(--jps-text); }
/* 予約の並び：「JPS予約」を押したときだけ出す（今までの見た目 ?chat=0 では一覧の下にいつも出す） */
.jps-list { padding: 4px 0 8px; }
.mc .jps-list { display: none; }
.mc #aiChatList.jps-mode .jps-list { display: block; }
.mc #aiChatList.jps-mode .aichat-item, .mc #aiChatList.jps-mode > p.note { display: none !important; }
.mc .jps-card.mc-hide { display: none !important; }   /* 検索で隠す */
.jps-list-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 800; color: var(--mc-text); padding: 4px 4px 8px; }
.jps-list-h b { font-size: 11px; font-weight: 700; color: var(--jps-text); background: var(--jps-soft); border-radius: 999px; padding: 1px 8px; }
.jps-hint { flex-basis: 100%; font-size: 11.5px; font-weight: 400; line-height: 1.5; color: var(--mc-muted); }
.jps-card { box-sizing: border-box; margin: 4px 0; border: 1px solid var(--mc-line); border-radius: 14px; padding: 12px 14px; background: var(--mc-bg); color: var(--mc-text); display: flex; flex-direction: column; gap: 4px; box-shadow: 0 6px 18px rgba(35, 52, 44, .05); }
.jps-card.jps-done { background: var(--mc-soft); box-shadow: none; }
.jps-c-h { display: flex; gap: 6px; align-items: center; font-size: 12px; white-space: nowrap; }
.jps-no { font-weight: 800; color: var(--jps-text); }
.jps-shop { color: var(--mc-muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.jps-st { margin-left: auto; white-space: nowrap; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; color: var(--mc-muted); background: var(--mc-pane); }
.jps-new .jps-st { color: var(--jps-text); background: var(--jps-soft); }
.jps-done .jps-st { color: var(--mc-accent); background: var(--mc-bg); }
.jps-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.jps-when { font-size: 12.5px; white-space: nowrap; }
.jps-sub { font-size: 12px; color: var(--mc-muted); }
.jps-wait { font-size: 12px; font-weight: 700; color: var(--jps-wait-text); background: var(--jps-wait); border-radius: 10px; padding: 7px 8px; text-align: center; margin-top: 6px; }
.jps-list .btn.jps-open { margin-top: 6px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 8px 10px; background: var(--mc-accent); color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: 0 6px 16px rgba(82, 122, 106, .22); }
.jps-list .btn.jps-open:hover { filter: brightness(1.06); }
.jps-list .btn.jps-open .chicon { display: inline-block; }
/* 一覧の「JPS予約」の印・会話の上の予約の帯 */
.jps-tag { display: inline-block; color: var(--jps-text); background: var(--jps-soft); border-radius: 999px; padding: 0 7px; margin-right: 5px; font-size: 10.5px; font-weight: 700; }
.jps-hit { margin: 10px 26px 0; padding: 10px 14px; border-radius: 14px; background: var(--jps-soft); color: var(--jps-text); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .jps-hit { margin: 8px 12px 0; } }

/* 2026-11-29 AI返信だけの画面（USER「AI返信だけスマホで使えるようにしたい」「AI返信だけ切り取る感じで」）
   ?ai=1 で開いた端末は <html class="ai-only">。上のメニュー・役割の切り替え・フィードバック・ほかの画面への入口を出さない */
.ai-only #subnav, .ai-only #roleSwitch, .ai-only #fbBtn, .ai-only .aichat-pageh, .ai-only #miMaster, .ai-only #miAccounts { display: none !important; }
html:not(.ai-only) #miAiOnlyOff, .ai-only #miAiOnlyOn { display: none !important; }
.ai-only #main { padding-top: 8px; }
.ai-only .appbar .brand .logo::after { content: ' AI返信'; font-size: 12px; letter-spacing: 0; }

/* 2026-11-29 内勤へのメモ（AIが自分で決めずに残したこと・送ったリンク） */
.aichat-memo{margin:6px 12px;padding:8px 12px;border-left:4px solid var(--jps-wait-text,#b08a3e);background:var(--jps-wait,#fbf3e2);color:var(--mc-text,inherit);border-radius:8px;font-size:13px}
.aichat-memo b{display:block;font-size:12px;margin-bottom:2px;color:var(--jps-wait-text,#8a6a2a)}
.aichat-memo ul{margin:0;padding-left:18px}
.aichat-memo li{margin:1px 0;word-break:break-all}
