/* =========================================================
   myengine.io — chat + new-landing additions.
   Layers on top of tokens.css and v2.css.
   ========================================================= */

/* ---------- hero subline ---------- */
.hero-sub {
  margin: 18px auto 30px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--me-ink-2);
}

/* ---------- demo chat frame ---------- */
.chatdemo { max-width: 660px; margin: 0 auto; }

.chat {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(245, 243, 236, 0.92), rgba(245, 243, 236, 0.92));
  min-height: 380px;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  animation: msg-in 0.28s var(--me-ease-out);
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg.agent {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--me-line);
  border-bottom-left-radius: 6px;
  color: var(--me-ink);
  box-shadow: 0 1px 3px rgba(20, 20, 19, 0.05);
}
.msg.customer {
  align-self: flex-end;
  background: var(--me-blue);
  border-bottom-right-radius: 6px;
  color: #fff;
}
.msg.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 14px 16px;
}
.msg.typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--me-muted);
  animation: tdot 1.1s infinite;
}
.msg.typing i:nth-child(2) { animation-delay: 0.18s; }
.msg.typing i:nth-child(3) { animation-delay: 0.36s; }
.msg.typing .t-label { font-size: 12.5px; color: var(--me-muted); font-style: italic; }
/* the logo IS the loader: arc spins + redraws, core breathes */
.msg.typing { gap: 7px; padding: 11px 15px; }
.msg.typing .tlogo { width: 21px; height: 21px; flex-shrink: 0; display: block; }
.msg.typing .tl-arc { transform-origin: 50% 50%; animation: tlspin 1.5s linear infinite, tldraw 3s ease-in-out infinite; }
.msg.typing .tl-core { transform-origin: 50% 50%; animation: tlbreathe 1.5s ease-in-out infinite; }
@keyframes tlspin { to { transform: rotate(360deg); } }
@keyframes tldraw { 0%, 100% { stroke-dasharray: 60 160; } 50% { stroke-dasharray: 185 35; } }
@keyframes tlbreathe { 0%, 100% { transform: scale(0.78); } 50% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) {
  .msg.typing .tl-arc { animation: none; }
  .msg.typing .tl-core { animation: tlfade 1.6s ease-in-out infinite; }
}
@keyframes tlfade { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
/* streaming reply cursor */
.msg.agent.streaming::after { content: '▍'; color: var(--me-blue); animation: tlblink 1s steps(2) infinite; margin-left: 1px; }
@keyframes tlblink { 50% { opacity: 0; } }
@keyframes tdot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* structured event card (order / complaint filed) */
.msg.event {
  align-self: center;
  max-width: 92%;
  width: 100%;
  background: var(--me-blue-lo);
  border: 1px solid rgba(217, 119, 87, 0.4);
  border-radius: var(--me-r);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--me-navy);
}
.msg.event .ev-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.msg.event .ev-title .tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--me-blue); color: #fff; font-size: 11px;
}
.msg.event ul { margin: 0; padding-left: 18px; }
.msg.event li { margin: 2px 0; }
.msg.event .ev-note { margin-top: 6px; color: var(--me-ink-2); }
.msg.event.complaint { background: oklch(0.96 0.02 60); border-color: oklch(0.85 0.06 60); }
.msg.event.complaint .ev-title .tick { background: oklch(0.62 0.14 50); }

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px 4px;
}
.chat-chips button {
  border: 1px solid var(--me-line-2);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--me-sans);
  font-size: 13px;
  color: var(--me-ink-2);
  cursor: pointer;
  transition: all 0.18s var(--me-ease);
}
.chat-chips button:hover {
  border-color: var(--me-blue);
  color: var(--me-blue);
  transform: translateY(-1px);
}

.chat-inputrow {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
}
.chat-inputrow input {
  flex: 1;
  border: 1px solid var(--me-line-2);
  border-radius: 999px;
  padding: 11px 18px;
  font-family: var(--me-sans);
  font-size: 14.5px;
  color: var(--me-ink);
  background: #fff;
  outline: none;
  transition: border-color 0.18s var(--me-ease), box-shadow 0.18s var(--me-ease);
}
.chat-inputrow input:focus {
  border-color: var(--me-blue);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}
.chat-inputrow button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--me-blue);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s var(--me-ease), background 0.15s var(--me-ease);
}
.chat-inputrow button:hover { background: var(--me-blue-hi); transform: translateY(-1px); }
.chat-inputrow button:disabled { opacity: 0.5; cursor: default; transform: none; }

.chat-foot {
  border-top: 1px solid var(--me-line);
  background: #fff;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--me-muted);
  text-align: center;
}
.chat-foot a { color: var(--me-blue); font-weight: 600; text-decoration: none; }
.chat-foot a:hover { text-decoration: underline; }

/* ---------- how it works: steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 46px;
}
.step {
  background: #fff;
  border: 1px solid var(--me-line);
  border-radius: var(--me-r-lg);
  padding: 28px 26px;
  box-shadow: 0 14px 34px -26px rgba(20, 20, 19, 0.3);
}
.step-num {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--me-blue-lo);
  color: var(--me-blue);
  font-family: var(--me-mono);
  font-weight: 600;
  margin-bottom: 16px;
}
.step h3 {
  font-family: var(--me-serif);
  font-size: 21px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--me-ink);
}
.step p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--me-ink-2); }

/* ---------- will / will never ---------- */
.lane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 26px;
}
.lane-col {
  border-radius: var(--me-r-lg);
  padding: 26px 28px;
  border: 1px solid var(--me-line);
  background: #fff;
}
.lane-col.no { background: var(--me-navy); border-color: var(--me-navy); }
.lane-col h4 {
  margin: 0 0 14px;
  font-family: var(--me-serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--me-ink);
}
.lane-col.no h4 { color: #fff; }
.lane-col ul { margin: 0; padding: 0; list-style: none; }
.lane-col li {
  position: relative;
  padding: 6px 0 6px 26px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--me-ink-2);
}
.lane-col.no li { color: oklch(0.82 0.02 250); }
.lane-col li::before {
  content: '✓';
  position: absolute; left: 0; top: 6px;
  color: var(--me-blue);
  font-weight: 700;
}
.lane-col.no li::before { content: '✕'; color: oklch(0.7 0.14 25); }

/* ---------- pilot pricing ---------- */
.pilot-plans { grid-template-columns: minmax(0, 460px); justify-content: center; }

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .lane { grid-template-columns: 1fr; }
  .msg { max-width: 88%; }
}
