/* ===========================================================================
   SolutionsSales -- 画面イメージ (FRAGMENT:mock), part 3:
   AIエージェント chat: thread, work log, composer. Behaviour: sales-mock-3.js.
   - No JS (.sa-mock-demo not .is-live): the whole exchange shows.
   - Live: data-chat="idle" shows the greeting only, "run" adds the request +
     the work log, "done" adds the answer with its 3 suggestions.
   - Motion only under html.sa-motion, and only while a request plays
     (.is-play), so reopening the tab does not replay the exchange.
   Contrast: --muted on --sa-flat 4.93:1, on #FFF 5.48:1; --sa-acc-ink on
   --sa-tint 6.29:1; #FFF on --sa-acc 5.79:1; --ink on both tints > 12:1.
   =========================================================================== */
.sa-mock-chat { display: flex; flex-direction: column; gap: 16px; }
.sa-mock-win .sa-mock-thread { display: grid; align-content: start; gap: 14px; }
.sa-mock-demo.is-live .sa-mock-thread { min-height: 200px; }
.sa-mock-msg { display: flex; align-items: flex-start; gap: 10px; }
.sa-mock-msg--me { justify-content: flex-end; }
.sa-mock-av { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sa-acc); font-size: 13px; font-weight: 700; line-height: 1; color: var(--white); }
.sa-mock-av[data-c="ai"] { background: #FFF url("assets/sales-ai-face.webp") center / cover no-repeat; color: transparent; box-shadow: 0 0 0 1px rgba(16, 42, 67, 0.14); }   /* NAL's AI character "Avatar" wherever the agent speaks; the "AI" text stays for screen readers */
.sa-mock-msg--me .sa-mock-me { width: 28px; height: 28px; margin-left: 0; font-size: 12px; }
.sa-mock-bub { min-width: 0; max-width: 560px; padding: 10px 14px 11px; border-radius: 4px 12px 12px 12px; background: var(--sa-flat); font-size: 13.5px; line-height: 1.85; color: var(--ink); }
.sa-mock-msg--me .sa-mock-bub { border-radius: 12px 4px 12px 12px; background: var(--sa-tint); }
.sa-mock-win .sa-mock-who { margin: 0 0 1px; font-size: 13px; font-weight: 700; line-height: 1.6; color: var(--muted); }
.sa-mock-msg--me .sa-mock-who { color: var(--sa-acc-ink); }

/* ---- work log: 4 steps the agent runs --------------------------------------- */
.sa-mock-bub--log { max-width: 620px; padding: 12px 16px 14px; border: 1px solid var(--line-strong); background: var(--white); }
.sa-mock-win .sa-mock-log-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 700; line-height: 1.6; color: var(--navy); }
.sa-mock-log-h::before { content: ""; flex: none; width: 11px; height: 11px; background: var(--sa-acc); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.sa-mock-win .sa-mock-log { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.sa-mock-log > li { position: relative; display: flex; flex-direction: column; padding-left: 28px; }
.sa-mock-log b { font-size: 13px; line-height: 1.6; color: var(--navy); }
.sa-mock-log small { font-size: 13px; line-height: 1.6; color: var(--muted); }
/* status mark: empty ring = waiting, turning ring = running, filled check = done */
.sa-mock-log > li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; box-sizing: border-box; border: 2px solid var(--sa-rule); border-radius: 50%; }
.sa-mock-log > li.is-run::before { border-color: var(--sa-tint); border-top-color: var(--sa-acc); }
.sa-mock-log > li.is-done::before { border-color: var(--sa-acc); background: var(--sa-acc); }
.sa-mock-log > li.is-done::after { content: ""; position: absolute; left: 5px; top: 7.5px; width: 8px; height: 4px; border: solid var(--white); border-width: 0 0 2px 2px; transform: rotate(-45deg); }

/* ---- answer: one line, then the suggestion cards ---------------------------- */
.sa-mock-bub--ans { flex: 1 1 auto; max-width: none; padding: 0; background: none; }
.sa-mock-bub--ans > p:first-child { display: inline-block; margin: 0 0 10px; padding: 10px 14px 11px; border-radius: 4px 12px 12px 12px; background: var(--sa-flat); }

/* ---- composer ---------------------------------------------------------------- */
.sa-mock-cmp { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); box-shadow: 0 2px 6px -2px rgba(16, 42, 67, 0.10); }
.sa-mock-win .sa-mock-cmp-in { flex: 1 1 auto; min-width: 0; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.sa-mock-chat[data-chat="idle"] .sa-mock-cmp-in { color: var(--ink); }
.sa-mock-cmp .sa-mock-btn { flex: none; }

/* ---- live states --------------------------------------------------------------- */
.sa-mock-demo.is-live .sa-mock-chat[data-chat="idle"] [data-after],
.sa-mock-demo.is-live .sa-mock-chat[data-chat="run"] [data-after="3"] { display: none; }
@keyframes sa-mock-spin { to { transform: rotate(360deg); } }
html.sa-motion .sa-mock-log > li.is-run::before { animation: sa-mock-spin 0.8s linear infinite; }
html.sa-motion .sa-mock-chat[data-chat="run"] .sa-mock-log-h::before { animation: sa-mock-blink 0.9s ease-in-out infinite; }
html.sa-motion .sa-mock-chat.is-play [data-after] { animation: sa-mock-in 0.45s var(--ease-out) both; }
html.sa-motion .sa-mock-chat.is-play [data-after="2"] { animation-delay: 0.3s; }
html.sa-motion .sa-mock-chat.is-play[data-chat="done"] .sa-mock-sug { animation: sa-mock-in 0.45s var(--ease-out) both; }
html.sa-motion .sa-mock-chat.is-play[data-chat="done"] .sa-mock-sug:nth-child(2) { animation-delay: 0.12s; }
html.sa-motion .sa-mock-chat.is-play[data-chat="done"] .sa-mock-sug:nth-child(3) { animation-delay: 0.24s; }
html.sa-motion .sa-mock-log > li.is-done::after { animation: sa-mock-pop 0.3s var(--ease-out) both; }

/* ---- small screens --------------------------------------------------------------- */
@media (max-width: 639px) {
  .sa-mock-win .sa-mock-log { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sa-mock-demo.is-live .sa-mock-thread { min-height: 0; }
  .sa-mock-msg { gap: 8px; }
  .sa-mock-av, .sa-mock-msg--me .sa-mock-me { width: 24px; height: 24px; }
  .sa-mock-bub { padding: 9px 12px 10px; font-size: 13px; }
  .sa-mock-cmp { flex-wrap: wrap; padding: 10px 10px 10px 12px; }
  .sa-mock-cmp .sa-mock-btn { margin-left: auto; }
}
/* four labels no longer fit one row on a phone ("AIエージェント"): 2 x 2, one line each */
@media (max-width: 479px) {
  .sa-mock .sa-mock-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-mock .sa-mock-tab { flex-direction: row; gap: 6px; min-height: 46px; padding: 6px 8px; }
}
