/* ThinkChat v2 — miniature product UI used by the landing hero and the feature demos.
   Animation model: JS sets data-stage on .mock and adds .is-on to [data-at] elements whose
   stage has been reached (and removes it after data-until). Until v2-mock.js marks a demo .is-live, every [data-at]
   element is simply visible, so each mock reads as a finished screenshot. */

.mock {
  --m-bg: #fffdf9;
  --m-side: #f6efe8;
  --m-line: #eee3da;
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--m-bg);
  box-shadow: 0 30px 70px rgba(90, 65, 55, .14), 0 2px 6px rgba(90, 65, 55, .05);
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  color: var(--aubergine);
  text-align: left;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--m-line);
  background: #fbf6f0;
}
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #e8dcd2; }
.mock-bar i:nth-child(1) { background: #ffb3a7; }
.mock-bar i:nth-child(2) { background: #ffd9a0; }
.mock-bar i:nth-child(3) { background: #b9e2c6; }
.mock-bar b { margin-left: 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: -.01em; }
.mock-bar .pill { margin-left: auto; }
.mock-bar .pill + .pill { margin-left: 6px; }
.mock-bar .pill.hide + .pill { margin-left: auto; }

.mock-body { display: grid; grid-template-columns: 46px minmax(0, 1fr); min-height: 340px; }

.mock-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  background: var(--m-side);
  border-right: 1px solid var(--m-line);
}
.mock-side img { width: 16px; height: 21px; object-fit: contain; margin-bottom: 6px; }
.mock-side span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #a89a92; }
.mock-side span svg { width: 15px; height: 15px; }
.mock-side span.on { background: #fff; color: var(--coral); box-shadow: 0 2px 6px rgba(90, 65, 55, .08); }

.mock-main { position: relative; padding: 16px; min-width: 0; }
.mock-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }

.mock-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.mock-h b { font-size: 14px; font-weight: 800; letter-spacing: -.03em; }
.mock-h small { font-size: 10.5px; color: var(--muted); font-weight: 600; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ivory);
  border: 1px solid var(--m-line);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.pill.coral { background: var(--coral); border-color: var(--coral); color: #fff; }
.pill.green { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.pill.lav { background: var(--lavender); border-color: var(--lavender); color: var(--violet); }
.pill.dark { background: var(--aubergine); border-color: var(--aubergine); color: #fff; }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }

/* Rows (inbox, leads, ledger) */
.m-rows { display: grid; gap: 6px; }
.m-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--m-line);
  border-radius: 12px;
  background: #fff;
}
.m-av {
  position: relative;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lavender); color: var(--violet);
  font-size: 11.5px; font-weight: 800;
}
.m-row:nth-child(even) .m-av { background: var(--peach); color: var(--coral-dark); }
.m-av img { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; padding: 1px; border-radius: 50%; background: #fff; }
.m-row b { display: block; font-size: 12px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row .sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row .end { display: grid; justify-items: end; gap: 4px; font-size: 10px; color: var(--muted); font-weight: 600; }

/* Chat */
.m-chat { display: flex; flex-direction: column; gap: 7px; }
.m-b { max-width: 86%; padding: 8px 11px; border-radius: 13px; font-size: 11.5px; line-height: 1.45; }
.m-b.them { align-self: flex-start; background: var(--lavender); border-bottom-left-radius: 4px; }
.m-b.tc { align-self: flex-end; background: var(--peach); border-bottom-right-radius: 4px; }
.m-b.agent { align-self: flex-end; background: var(--aubergine); color: #fff; border-bottom-right-radius: 4px; }
.m-b small { display: block; margin-bottom: 2px; font-size: 9.5px; font-weight: 700; opacity: .7; }
.m-quick { align-self: flex-end; display: flex; gap: 4px; }
.m-quick span { padding: 3px 9px; border: 1px solid var(--coral); border-radius: 999px; background: #fff; color: var(--coral-dark); font-size: 10px; font-weight: 700; }
.m-quick span.tap { background: var(--coral); color: #fff; }
.m-note { align-self: center; padding: 4px 10px; border-radius: 999px; background: var(--ivory); border: 1px solid var(--m-line); font-size: 10px; font-weight: 700; color: var(--muted); }
.m-typing { align-self: flex-end; display: inline-flex; gap: 3px; padding: 10px 12px; border-radius: 13px; background: var(--peach); }
.m-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--coral-dark); animation: m-dot 1.1s infinite; }
.m-typing i:nth-child(2) { animation-delay: .15s; }
.m-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes m-dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.m-panel { border: 1px solid var(--m-line); border-radius: 14px; background: #fff; padding: 12px; }
.m-panel-h { margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Knowledge cards */
.m-card { padding: 8px 10px; border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-bg); transition: border-color .35s, box-shadow .35s, background .35s; }
.m-card + .m-card { margin-top: 6px; }
.m-card b { display: block; font-size: 11px; }
.m-card span { font-size: 10.5px; color: var(--muted); }
.m-card.hit { border-color: var(--coral); background: #fff; box-shadow: 0 0 0 3px rgba(255, 107, 87, .14); }
.m-card.miss { border-style: dashed; }

/* Flow canvas */
.m-canvas {
  position: relative;
  height: 290px;
  border-radius: 14px;
  background-color: #fbf6f0;
  background-image: radial-gradient(#e7dbd1 1px, transparent 1px);
  background-size: 14px 14px;
  overflow: hidden;
}
.m-node {
  position: absolute;
  width: 132px;
  padding: 9px 10px;
  border: 1px solid var(--m-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(90, 65, 55, .07);
  transition: border-color .35s, box-shadow .35s, transform .35s;
}
.m-node small { display: block; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.m-node b { display: block; margin-top: 2px; font-size: 11.5px; }
.m-node span { display: block; font-size: 10px; color: var(--muted); }
.m-node.here { border-color: var(--coral); transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(255, 107, 87, .16), 0 10px 22px rgba(90, 65, 55, .1); }
.m-node.here small { color: var(--coral-dark); }
.m-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.m-canvas path { fill: none; stroke: #d9cabd; stroke-width: 1.6; stroke-dasharray: 4 4; }

/* Calendar */
.m-cal { display: grid; grid-template-columns: 38px repeat(3, minmax(0, 1fr)); gap: 4px; font-size: 10px; }
.m-cal .hd { text-align: center; font-weight: 800; color: var(--muted); padding-bottom: 2px; font-size: 9.5px; line-height: 1.2; }
.m-cal .tm { color: var(--muted); font-weight: 600; padding-top: 6px; }
.m-slot { height: 30px; border-radius: 7px; background: #f7f1ea; transition: background .35s, box-shadow .35s; }
.m-slot.busy { background: repeating-linear-gradient(45deg, #eee4db 0 4px, #f7f1ea 4px 8px); }
.m-slot.offer { background: #fff; box-shadow: inset 0 0 0 1.5px var(--coral); }
.m-slot.booked { background: var(--violet); color: #fff; padding: 4px 6px; font-weight: 700; font-size: 9.5px; line-height: 1.2; }

/* Form */
.m-field { margin-bottom: 8px; }
.m-field label { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 700; color: var(--muted); }
.m-input { height: 28px; padding: 6px 9px; border: 1px solid var(--m-line); border-radius: 8px; background: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.m-btn { display: grid; place-items: center; height: 30px; border-radius: 8px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; transition: transform .2s; }
.m-btn.press { transform: scale(.96); background: var(--coral-dark); }


.pill.hide { display: none; }
.pill.deleted { text-decoration: line-through; opacity: .6; }

/* ---- Stage animation ---- */
/* Title-bar status pills swap in place. */
.mock.is-live .mock-bar [data-at]:not(.is-on) { display: none; }
/* Inline swaps (e.g. a changing percentage) collapse instead of stacking. */
.mock.is-live small > [data-at]:not(.is-on) { display: none; }
.mock.is-live [data-at] { opacity: 0; transform: translateY(6px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.mock.is-live [data-at].is-on { opacity: 1; transform: none; }
/* Collapsed until reached, so later items don't leave gaps in a chat column. */
.mock.is-live .m-chat > [data-at]:not(.is-on),
.mock.is-live .m-rows > [data-at]:not(.is-on) { display: none; }
.mock.is-live .m-chat > [data-at].is-on,
.mock.is-live .m-rows > [data-at].is-on { animation: m-in .42s var(--ease) both; }
@keyframes m-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .mock-body { grid-template-columns: 0 minmax(0, 1fr); }
  .mock-side { visibility: hidden; }
  .mock-split { grid-template-columns: 1fr; }
  .mock-main { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .m-typing i { animation: none; }
  .mock.is-live [data-at] { transition: none; }
}
