/* ══ Interactive demos on the service pages (js/demos.js) ═══════════════════════════════════════ */
.dm-sec { padding: clamp(50px, 7vw, 100px) 0; background: var(--off-white, #f7f6f1); }
.dm-sec .hx-sub { margin-bottom: clamp(24px, 3vw, 36px); }
.dm-stage { min-height: 200px; }
.dm-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; font-size: .88rem; color: var(--muted, #6b7280); }
.dm-reset { border: 0; background: none; padding: 0; cursor: pointer; font: 600 .88rem/1.2 var(--font, 'Poppins', sans-serif); color: var(--brand, #7851a9); text-decoration: underline; text-underline-offset: 3px; }

/* ── Chatbot ── */
.dm-chat { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 28px); align-items: stretch; }
.dm-window, .dm-portal { background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 22px; box-shadow: 0 30px 60px -40px rgba(40, 20, 80, .35); }
.dm-window { display: flex; flex-direction: column; height: 460px; overflow: hidden; }
.dm-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border, #e5e7eb); }
.dm-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #2f7d4f, #5aa86f); }
.dm-who { flex: 1; min-width: 0; }
.dm-who b { display: block; font-size: .98rem; color: var(--text, #1a1a1a); }
.dm-who span { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted, #6b7280); }
.dm-who i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.dm-time { font-size: .78rem; color: var(--muted, #9ca3af); font-variant-numeric: tabular-nums; }
.dm-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.dm-msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: .93rem; line-height: 1.5; animation: hxFade .3s ease both; }
.dm-msg.bot { align-self: flex-start; background: var(--surface-2, #f3f1f8); color: var(--text, #1a1a1a); border-bottom-left-radius: 6px; }
.dm-msg.me { align-self: flex-end; background: #2f7d4f; color: #fff; border-bottom-right-radius: 6px; }
.dm-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.dm-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted, #9ca3af); animation: dmDot 1.1s ease-in-out infinite; }
.dm-typing i:nth-child(2) { animation-delay: .15s; } .dm-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dmDot { 0%, 100% { opacity: .3; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }
.dm-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--border, #e5e7eb); min-height: 30px; }
.dm-chip { padding: 8px 13px; border-radius: 999px; border: 1px solid #b7d8c2; background: var(--surface, #fff); color: #22603c; cursor: pointer;
  font: 500 .86rem/1.2 var(--font, 'Poppins', sans-serif); transition: background .2s, transform .25s; animation: hxFade .35s ease both; }
.dm-chip:hover { background: #eef7f1; transform: translateY(-1px); }

.dm-portal { padding: 18px; display: flex; flex-direction: column; }
.dm-portal-h { margin: 0; font-size: .8rem; font-weight: 600; color: var(--brand, #7851a9); }
.dm-portal-sub { margin: 2px 0 14px; font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; color: var(--text, #1a1a1a); }
.dm-leads { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.dm-empty { margin: auto 0; padding: 20px; text-align: center; font-size: .88rem; color: var(--muted, #9ca3af); border: 1.5px dashed var(--border, #e5e7eb); border-radius: 14px; }
.dm-lead { padding: 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; animation: dmIn .6s var(--hx-ease, ease) both; }
@keyframes dmIn { from { opacity: 0; transform: translateY(-10px) scale(.98); box-shadow: 0 0 0 4px rgba(120, 81, 169, .25); } }
.dm-lead-top { display: flex; align-items: center; gap: 8px; }
.dm-lead-top b { font-size: .98rem; color: var(--text, #1a1a1a); }
.dm-portal-note { margin: -6px 0 14px; font-size: .86rem; color: var(--muted, #6b7280); }
.dm-portal-note b { font-size: 1.05rem; color: var(--brand, #7851a9); margin-left: 4px; }
.dm-lead { background: var(--off-white, #f8f9fc); }
.dm-lead-top { justify-content: space-between; }
.dm-stage-sel { font: 600 .8rem/1.2 var(--font, 'Poppins', sans-serif); padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); color: var(--text, #1a1a1a); }
.dm-lead[data-stage="contacted"] { opacity: .6; }
.dm-leads { gap: 10px; }
.dm-lead[data-stage="won"] { border-color: rgba(22, 163, 74, .45); }
.dm-lead-src { margin: 4px 0 0; font-size: .78rem; color: var(--muted, #6b7280); }
.dm-lead-chips { margin: 8px 0 0; }
.dm-lead-chips span { display: inline-block; padding: 4px 10px; border-radius: 8px; background: rgba(120, 81, 169, .08); color: var(--brand, #7851a9); font-size: .82rem; font-weight: 600; }
.dm-lead-msg { margin: 8px 0 0; font-size: .9rem; color: var(--text, #1a1a1a); }
@media (max-width: 760px) {
  .dm-chat { grid-template-columns: minmax(0, 1fr); }
  .dm-window { height: 420px; }
}
@media (prefers-reduced-motion: reduce) { .dm-msg, .dm-chip, .dm-lead, .dm-typing i { animation: none; } }

/* ── SEO: the portal's search card ── */
.dm-search { background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f1); border-radius: 18px; padding: clamp(18px, 2.6vw, 26px); box-shadow: 0 30px 60px -40px rgba(40, 20, 80, .35); }
.dm-s-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dm-s-period { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: var(--muted, #4f5470); }
.dm-s-tabs, .dm-s-ranges { display: flex; gap: 6px; flex-wrap: wrap; }
.dm-s-tabs button { border: 1px solid var(--border, #e4e7f1); border-radius: 100px; background: var(--surface, #fff); color: var(--muted, #4f5470); font: 700 11px/1.2 var(--font, 'Poppins', sans-serif); padding: 4px 10px; cursor: pointer; }
.dm-s-ranges { margin-top: 14px; }
.dm-s-ranges button { min-height: 34px; padding: 7px 13px; border-radius: 100px; border: 1px solid var(--border, #e4e7f1); background: var(--surface, #fff); color: var(--muted, #4f5470); font: 700 12px/1.2 var(--font, 'Poppins', sans-serif); cursor: pointer; transition: border-color .2s, color .2s; }
.dm-s-tabs button:hover, .dm-s-ranges button:hover { border-color: #7851a9; color: #6b4896; }
.dm-s-tabs button.on, .dm-s-ranges button.on { background: #7851a9; border-color: #7851a9; color: #fff; }
.dm-s-head { margin-top: 18px; }
.dm-s-big { display: block; font-size: 38px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--text, #0f1228); font-variant-numeric: tabular-nums; }
.dm-s-sub { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted, #3c4160); }
.dm-s-chart { display: flex; margin-top: 18px; }
.dm-s-y { width: 34px; height: 160px; margin-top: 8px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted, #535772); font-variant-numeric: tabular-nums; }
.dm-s-plot { position: relative; flex: 1; min-width: 0; height: 180px; touch-action: pan-y; cursor: crosshair; }
.dm-s-plot svg { display: block; width: 100%; height: 180px; overflow: visible; }
.dm-grid { stroke: #eef0f7; stroke-width: 1; vector-effect: non-scaling-stroke; }
.dm-avg { fill: none; stroke: #7851a9; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dm-daily { fill: none; stroke: rgba(120, 81, 169, .28); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.dm-prev { fill: none; stroke: #8a8ea6; stroke-opacity: .55; stroke-width: 2; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.dm-marks { position: absolute; z-index: 1; left: 0; right: 0; bottom: 6px; height: 16px; pointer-events: none; }
.dm-mark { position: absolute; bottom: 0; width: 22px; height: 16px; margin-left: -11px; pointer-events: auto; cursor: help; }
.dm-mark::after { content: ""; position: absolute; left: 7px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: #2f9e6b; box-shadow: 0 0 0 2px var(--surface, #fff); transition: transform .2s, background .2s; }
.dm-mark:hover::after { background: #1f7c52; transform: scale(1.25); }
.dm-scrub { position: absolute; z-index: 3; top: 0; bottom: 0; width: 1px; background: rgba(120, 81, 169, .45); pointer-events: none; animation: hxFade .14s ease both; }
.dm-scrub > b { position: absolute; left: -5.5px; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: #7851a9; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(28, 20, 48, .28); box-sizing: border-box; }
.dm-tip { position: absolute; top: 0; left: 10px; white-space: nowrap; background: #241a3a; color: #fff; border-radius: 9px; padding: 7px 10px; font-size: 11.5px; line-height: 1.35; box-shadow: 0 4px 14px rgba(28, 20, 48, .22); }
.dm-scrub.flip .dm-tip { left: auto; right: 10px; }
.dm-tip span { display: block; opacity: .72; }
.dm-tip b { display: block; position: static; width: auto; height: auto; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 13px; font-weight: 800; }
.dm-s-x { display: flex; justify-content: space-between; padding-left: 44px; margin-top: 6px; font-size: 11px; color: var(--muted, #535772); }
.dm-s-vs { margin: 14px 0 0; font-size: 13px; color: var(--muted, #4f5470); }
.dm-s-vs b { color: var(--text, #0f1228); }
.dm-s-legend { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 10px 0 0; font-size: 11px; color: var(--muted, #535772); }
.dm-s-legend span { display: inline-block; width: 18px; margin-left: 8px; }
.dm-s-legend .sw-prev { border-top: 2px dashed #8a8ea6; } .dm-s-legend .sw-day { border-top: 2px solid rgba(120, 81, 169, .32); } .dm-s-legend .sw-avg { border-top: 3px solid #7851a9; }
.dm-s-work { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted, #3c4160); }
.dm-s-work i { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: #2f9e6b; }
.dm-s-divide { height: 1px; background: var(--border, #e4e7f1); margin: 20px 0; }
.dm-s-kh { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: var(--muted, #4f5470); }
.dm-s-ksub { margin: 4px 0 8px; font-size: 12.5px; color: var(--muted, #3c4160); }
.dm-kw-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; border: 0; border-top: 1px solid var(--border, #e4e7f1); background: none; text-align: left; cursor: pointer; font-family: var(--font, 'Poppins', sans-serif); color: var(--text, #0f1228); }
.dm-kw-pos { width: 46px; flex-shrink: 0; font-size: 19px; font-weight: 800; color: var(--muted, #535772); font-variant-numeric: tabular-nums; }
.dm-kw-pos small { font-size: 11px; }
.dm-kw-pos.top { color: #6b4896; }
.dm-kw-q { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.dm-kw-q em { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 100px; background: rgba(120, 81, 169, .08); color: #6b4896; white-space: nowrap; }
.dm-mv { min-width: 56px; text-align: center; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 100px; }
.dm-mv.up { background: rgba(22, 163, 74, .08); color: #15803d; }
.dm-mv.down { background: rgba(220, 38, 38, .06); color: #dc2626; }
.dm-mv.new { background: rgba(120, 81, 169, .08); color: #6b4896; }
.dm-kw-chev { width: 8px; height: 8px; border: solid var(--muted, #8a8ea6); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform .3s; margin: 0 4px 4px; }
.dm-kw-row[aria-expanded="true"] .dm-kw-chev { transform: rotate(-135deg); margin-bottom: -2px; }
.dm-kw-detail { padding: 0 0 14px 58px; font-size: 13px; color: var(--muted, #3c4160); animation: hxFade .25s ease both; }
.dm-kw-detail p { margin: 0 0 10px; }
.dm-opp { display: inline-block; padding: 7px 12px; border-radius: 8px; background: rgba(120, 81, 169, .08); color: #6b4896; font-weight: 700; font-size: 12.5px; text-decoration: none; }
.dm-opp:hover { background: rgba(120, 81, 169, .16); }
@media (max-width: 560px) {
  .dm-kw-q { font-size: 13px; }
  .dm-kw-detail { padding-left: 0; }
  .dm-s-big { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { .dm-scrub, .dm-kw-detail { animation: none; } }
