/* Agent Smith demo — the LINE-OA walkthrough on the /ralph page.
 * Uses the house tokens declared in wiki.css; adds no new colour, radius or font.
 * Mobile first: the frame is a single column that grows a side rail at 900px.
 * Sizing rule, same as the pool: every track is minmax(0, …) and nothing may
 * widen the page — the chat scrolls VERTICALLY only, and its bubbles wrap.
 */

.smith-demo .sd-lede {
  max-width: 68ch; color: var(--ink-3); font-size: 15.5px; margin: 0 0 14px;
}

/* The honesty label. Deliberately not a subtle grey note: a chat window that
 * answers when you tap it reads as live, and the correction has to be as loud
 * as the impression it is correcting. */
.smith-demo .sd-disclosure {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFF8E6; border: 1px solid #F2D27A; border-left: 4px solid var(--hw-amber);
  border-radius: var(--fc-radius, 3px); padding: 12px 14px; margin-bottom: 16px;
  font-size: 13.5px; color: #6B4E00; line-height: 1.5;
}
.smith-demo .sd-disc-ic { flex: none; }
.smith-demo .sd-disc-ic.fc-ic { color: #6B4E00; line-height: 0; padding-top: 1px; }
.smith-demo .sd-disc-ic.fc-ic svg { width: 18px; height: 18px; }

.smith-demo .sd-grid {
  display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start;
}
@media (min-width: 900px) {
  .smith-demo .sd-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
}

/* ---------- the phone ---------- */
.sd-frame {
  min-width: 0; background: #8CABD9;                 /* LINE's chat wallpaper blue */
  border: 1px solid var(--line); border-radius: var(--fc-radius, 3px);
  overflow: hidden; box-shadow: none;
}
.sd-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-ink); color: var(--text-on-dark); padding: 10px 12px;
}
.sd-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: block; }
.sd-avatar svg { display: block; }
.sd-bar-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 120px; }
.sd-bar-name { font-weight: 700; font-size: 15px; }
.sd-bar-sub { font-size: 11.5px; color: var(--text-on-dark-muted); }
.sd-demo-pill {
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  background: var(--hw-amber); color: #4A3600; padding: 3px 9px; border-radius: var(--radius-pill);
}

.sd-chat {
  padding: 14px 12px; display: flex; flex-direction: column; gap: 10px;
  max-height: min(62vh, 520px); overflow-y: auto; overflow-x: auto;
  scroll-behavior: smooth;
}
.sd-sys {
  align-self: center; text-align: center; max-width: 46ch;
  background: rgba(20,20,19,.55); color: #fff; font-size: 11.5px; line-height: 1.5;
  padding: 7px 12px; border-radius: var(--fc-radius, 3px);
}
.sd-msg { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.sd-msg-av { flex: none; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; }
.sd-msg-av svg { width: 30px; height: 30px; display: block; }
.sd-bubbles { display: flex; flex-direction: column; gap: 7px; min-width: 0; max-width: 84%; }
.sd-msg.sd-me { justify-content: flex-end; }
.sd-msg.sd-me .sd-bubbles { align-items: flex-end; }

.sd-bub {
  background: #fff; color: var(--ink); border-radius: 8px; padding: 10px 13px;
  font-size: 14px; line-height: 1.55; box-shadow: var(--shadow-xs);
  border-bottom-left-radius: 3px; overflow-wrap: break-word;
}
.sd-bub.sd-mine {
  background: #048739; color: #fff;                  /* LINE green, one step darker: white text 4.6:1 */
  border-bottom-left-radius: 8px; border-bottom-right-radius: 3px;
}
.sd-bub.sd-bub-art { padding: 8px; background: #fff; }
:root[lang="th"] .sd-bub { line-height: 1.72; }

.sd-typing { display: inline-flex; gap: 4px; align-items: center; padding: 13px; }
.sd-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); display: block;
               animation: sd-blink 1.1s infinite ease-in-out; }
.sd-typing i:nth-child(2) { animation-delay: .18s; }
.sd-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes sd-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* ---------- suggested questions ---------- */
.sd-chips {
  background: var(--surface); border-top: 1px solid var(--line-soft);
  padding: 12px; display: flex; flex-wrap: wrap; gap: 8px;
}
.sd-chips-h {
  flex: 1 0 100%; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-4);
}
.sd-chip {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--hw-red-deep);
  background: #fff; border: 1.5px solid var(--hw-red-tint); border-radius: var(--radius-pill);
  padding: 8px 15px; min-height: 40px; cursor: pointer; max-width: 100%;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.sd-chip:hover { background: var(--hw-red-tint); border-color: var(--hw-red); }
.sd-chips-end { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sd-restart {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: transparent; border: 1.5px solid var(--line); border-radius: var(--radius-pill);
  padding: 9px 18px; min-height: 36px; cursor: pointer; max-width: 100%;
}
.sd-restart:hover { background: var(--surface-3); }
:root[lang="th"] .sd-chip, :root[lang="th"] .sd-restart { line-height: 1.4; }

/* ---------- artifacts inside a bubble ---------- */
.sd-art { border: 1px solid var(--line-soft); border-radius: var(--fc-radius, 3px); padding: 12px; min-width: 0; }
.sd-art-h { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
            color: var(--ink-4); margin-bottom: 9px; }
.sd-art-p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); }
.sd-art-foot { margin-top: 9px; font-size: 11.5px; color: var(--ink-4); line-height: 1.5; }
.sd-art-link { display: inline-block; margin-top: 9px; font-size: 13px; font-weight: 700; }

.sd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sd-steps li { display: flex; gap: 9px; align-items: baseline; font-size: 13.5px; color: var(--ink-2); }
.sd-step-n { flex: none; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
             color: var(--hw-red-deep); background: var(--hw-red-tint); border-radius: 5px; padding: 1px 5px; }

.sd-ex-tag {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  background: var(--surface-3); color: var(--ink-3); border-radius: var(--radius-pill);
  padding: 3px 9px; margin-bottom: 9px;
}
.sd-score-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sd-score-num { font-family: var(--font-mono); font-size: 30px; font-weight: 600; letter-spacing: -.02em;
                color: var(--hw-red-deep); line-height: 1; }
.sd-score-num span { font-size: .45em; color: var(--ink-4); margin-left: 2px; }
.sd-score-side { min-width: 0; }
.sd-score-name { font-size: 13px; font-weight: 700; }
.sd-verdict { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700;
              background: rgba(33,196,90,.14); color: #147A38; border-radius: var(--radius-pill); padding: 2px 9px; }
.sd-bars { display: grid; gap: 6px; margin-top: 11px; }
.sd-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 20px; gap: 8px; align-items: center;
              font-size: 12px; color: var(--ink-3); }
.sd-bar-t { height: 6px; border-radius: 3px; background: var(--surface-3); display: block; overflow: hidden; }
.sd-bar-f { display: block; height: 100%; background: var(--hw-red); border-radius: 3px; }
.sd-bar-v { font-family: var(--font-mono); font-size: 12px; text-align: right; color: var(--ink-2); }

.sd-kv { margin: 0; display: grid; gap: 5px; }
.sd-kv-row { display: grid; grid-template-columns: minmax(0, 96px) minmax(0, 1fr); gap: 10px; font-size: 13px; }
.sd-kv dt { color: var(--ink-4); }
.sd-kv dd { margin: 0; color: var(--ink); font-weight: 600; }
.sd-kv-row:last-child dd { color: var(--hw-red-deep); }

.sd-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sd-thumb { margin: 0; min-width: 0; }
.sd-thumb-img { display: block; border: 1px solid var(--line-soft); border-radius: 7px; overflow: hidden;
                aspect-ratio: 80 / 56; }
.sd-thumb-img svg { display: block; width: 100%; height: 100%; }
.sd-thumb figcaption { font-size: 11px; color: var(--ink-4); margin-top: 4px; }
.sd-stamp {
  margin-top: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-align: center;
  color: var(--hw-red-deep); border: 1px dashed var(--hw-red); border-radius: 5px; padding: 4px 6px;
}

.sd-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- side rail ---------- */
.sd-side {
  background: #fff; border: 1px solid var(--fc-rule, var(--line-soft)); border-left: var(--accent-bar);
  border-radius: var(--fc-radius, 3px); padding: 16px; min-width: 0; box-shadow: none;
}
.sd-side-h { margin: 0 0 12px; font-size: 16px; letter-spacing: -.01em; }
.sd-cap { display: flex; gap: 10px; margin-bottom: 12px; min-width: 0; }
.sd-cap-ic { flex: none; font-size: 17px; line-height: 1.3; }
/* the capability icons are the shared line set (js/icons.js, unify WP1), in VI red */
.sd-cap-ic.fc-ic { width: 20px; height: 22px; line-height: 0; color: var(--fc-red, var(--hw-red)); }
.sd-cap-ic.fc-ic svg { width: 20px; height: 20px; }
.sd-cap-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sd-cap-txt strong { font-size: 14px; }
.sd-cap-txt span { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.sd-side-cta { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .sd-chat { scroll-behavior: auto; }
  .sd-typing i { animation: none; opacity: .55; }
  .sd-chip, .sd-restart { transition: none; }
}
