/*
 * niche-demo.css: the demo phone and the lead board (the recorded real
 * conversation, then "Try it yourself"). Markup: views/partials/niche-demo-phone.hbs.
 * Client: public/js/niche-landing.js. Used by /ai-chatbot/<niche> and the
 * /ai-receptionist/<trade> pages. Tokens only (theme.css); a page can recolour
 * it by setting --brand-fill / --brand-ink on a wrapper.
 */
  /* The demo: the phone, the lead board beside it. */
  .dn-demo { padding: 18px 0 64px; }
  .dn-demo-note { max-width: 640px; margin: 0 auto 16px; text-align: center; font-size: 0.9rem; color: var(--ink-soft); }
  .dn-stage { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 360px); gap: 32px; justify-content: center; align-items: start; }
  .dn-phone { border: 1px solid var(--line-strong); border-radius: 34px; background: var(--surface-page); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; height: 600px; }
  .dn-status { display: flex; justify-content: space-between; padding: 10px 20px 4px; font-size: 0.74rem; font-weight: 700; color: var(--ink-muted); }
  .dn-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px; border-bottom: 1px solid var(--line-soft); }
  .dn-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--brand-fill-soft); display: grid; place-items: center; font-weight: 900; color: var(--ink); }
  .dn-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .dn-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
  .dn-who strong { font-size: 0.92rem; color: var(--ink); }
  .dn-who span { font-size: 0.74rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dn-tag { margin-left: auto; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.68rem; font-weight: 800; color: var(--ink-muted); white-space: nowrap; }
  .dn-thread { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
  .dn-msg { max-width: 84%; padding: 9px 13px; border-radius: 18px; font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; animation: dn-in 0.3s ease both; }
  .dn-msg--patient { align-self: flex-end; background: var(--brand-fill); color: var(--brand-ink); border-bottom-right-radius: 6px; }
  .dn-msg--agent { align-self: flex-start; background: var(--surface-sunken); color: var(--ink); border-bottom-left-radius: 6px; }
  .dn-msg--photo { padding: 4px; background: var(--brand-fill); }
  .dn-msg--photo img { display: block; width: 180px; height: auto; border-radius: 14px; }
  .dn-msg--photo small { display: block; padding: 4px 6px 2px; font-size: 0.68rem; color: var(--brand-ink-soft); }
  .dn-msg--system { align-self: center; max-width: 92%; background: none; color: var(--ink-muted); font-size: 0.74rem; text-align: center; padding: 4px; }
  .dn-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--surface-sunken); }
  .dn-typing--patient { align-self: flex-end; background: var(--brand-fill-soft); }
  .dn-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); animation: dn-blink 1s infinite; }
  .dn-typing i:nth-child(2) { animation-delay: 0.15s; } .dn-typing i:nth-child(3) { animation-delay: 0.3s; }
  @keyframes dn-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  @keyframes dn-blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
  .dn-compose { display: flex; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid var(--line-soft); }
  .dn-compose input { flex: 1 1 auto; min-width: 0; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-page); color: var(--ink); font: inherit; font-size: 1rem; }
  .dn-compose button { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand-fill); color: var(--brand-ink); font-size: 1.05rem; cursor: pointer; }
  .dn-compose button:disabled, .dn-compose input:disabled { opacity: 0.5; cursor: default; }
  .dn-controls { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
  .dn-controls .mk-btn { padding: 9px 16px; font-size: 0.86rem; }
  .dn-caption { max-width: 760px; margin: 18px auto 0; text-align: center; font-size: 0.8rem; color: var(--ink-muted); line-height: 1.55; }

  .dn-board { border: 1px solid var(--line); border-radius: 22px; background: var(--surface-raised); padding: 18px; }
  .dn-board-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
  .dn-board-head h3 { margin: 0; font-size: 1rem; color: var(--ink); }
  .dn-board-head span { font-size: 0.74rem; color: var(--ink-muted); }
  .dn-empty { margin: 0; padding: 26px 12px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; font-size: 0.86rem; color: var(--ink-muted); }
  .dn-lead { border: 1px solid var(--line); border-radius: 16px; background: var(--surface-page); padding: 14px; box-shadow: var(--shadow-md); animation: dn-pop 0.5s ease both; }
  @keyframes dn-pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
  .dn-lead-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .dn-lead-top strong { font-size: 1rem; color: var(--ink); }
  .dn-badge { margin-left: auto; padding: 3px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; background: var(--status-warning); color: var(--status-ink); }
  .dn-badge--new { margin-left: 0; background: var(--status-success); }
  .dn-lead dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 0.86rem; }
  .dn-lead dt { color: var(--ink-muted); }
  .dn-lead dd { margin: 0; color: var(--ink); font-weight: 700; }
  .dn-lead-sum { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; }
  .dn-lead-photo { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--ink-muted); }
  .dn-lead-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
  .dn-board-fine { margin: 12px 0 0; font-size: 0.74rem; color: var(--ink-muted); line-height: 1.5; }


@media (max-width: 860px) {
  .dn-stage { grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 420px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .dn-phone { height: 540px; border-radius: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .dn-msg, .dn-lead, .dn-typing i { animation: none; }
}
