.mh-app,.mh-hosted{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#0f172a;--mh:#0f766e}
.mh-app{max-width:860px;margin:0 auto;padding:12px}.mh-app *{box-sizing:border-box}
.mh-card{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:18px;margin:0 0 14px;box-shadow:0 1px 3px rgba(15,23,42,.05)}
.mh-hero{background:linear-gradient(135deg,#0f766e,#115e59);color:#fff;border:0}.mh-hero h2{margin:0 0 6px;color:#fff}.mh-hero p{margin:0;opacity:.92}
.mh-grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}@media(max-width:700px){.mh-grid2{grid-template-columns:1fr}}
.mh-app input[type=text],.mh-app input[type=email],.mh-app input[type=password],.mh-app textarea,.mh-app select{width:100%;padding:10px 12px;margin:6px 0 10px;border:1px solid #cbd5e1;border-radius:10px;font:inherit;background:#fff}
.mh-app label{display:block;font-size:13px;font-weight:600;color:#334155}.mh-app label input,.mh-app label textarea,.mh-app label select{font-weight:400}
.mh-app input[type=color]{display:block;width:60px;height:36px;margin:6px 0 10px;padding:2px}
.mh-hp{position:absolute!important;left:-9999px!important}
.mh-btn{display:inline-block;background:#0f766e;color:#fff!important;border:0;border-radius:10px;padding:10px 16px;font:600 14px/1.2 inherit;cursor:pointer;text-decoration:none}
.mh-btn.mh-alt{background:#e2e8f0;color:#0f172a!important}.mh-btn.mh-danger{background:#fee2e2;color:#b91c1c!important}.mh-btn:disabled{opacity:.6;cursor:wait}
.mh-actions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.mh-row{display:flex;justify-content:space-between;align-items:center;gap:8px}.mh-row h3{margin:0}
.mh-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:12px 0 4px}
.mh-stats div{background:#f1f5f9;border-radius:10px;padding:10px}.mh-stats b{display:block;font-size:18px}.mh-stats span{font-size:12px;color:#64748b}
.mh-note{font-size:13px;color:#64748b;margin:6px 0}.mh-link{color:#0f766e;word-break:break-all}
.mh-msg{font-size:13px;margin:6px 0 0;color:#b91c1c;min-height:1em}.mh-msg.ok{color:#15803d}
.mh-badge{font-size:12px;font-weight:700;padding:3px 9px;border-radius:99px;background:#e2e8f0}.mh-badge.mh-ready{background:#dcfce7;color:#166534}.mh-badge.mh-scanning{background:#fef9c3;color:#854d0e}.mh-badge.mh-error{background:#fee2e2;color:#b91c1c}
.mh-bar{height:8px;background:#e2e8f0;border-radius:99px;overflow:hidden}.mh-bar i{display:block;height:100%;width:5%;background:#0f766e;transition:width .4s}
.mh-ptext{font-size:13px;color:#475569;margin:6px 0 0}
.mh-preview iframe{width:100%;max-width:375px;height:560px;border:8px solid #0f172a;border-radius:26px;display:block;margin:10px auto}
details summary{cursor:pointer;font-weight:600;margin-top:8px}
/* hosted chat */
.mh-hosted{margin:0;background:#f1f5f9;height:100vh;height:100dvh;overflow:hidden}.mh-chat{width:100%;max-width:560px;height:100vh;height:100dvh;min-height:0;margin:0 auto;display:flex;flex-direction:column;background:#fff;box-shadow:0 0 30px rgba(0,0,0,.08);overflow:hidden}
.mh-head{flex:0 0 auto;background:var(--mh);color:#fff;padding:14px 16px;padding-top:max(14px,env(safe-area-inset-top))}.mh-head small{display:block;opacity:.85;font-size:12px;margin-top:2px}
.mh-msgs{flex:1 1 auto;min-height:0;min-width:0;width:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:14px;display:flex;flex-direction:column;gap:8px;scroll-behavior:smooth}
.mh-m{max-width:84%;padding:9px 13px;border-radius:16px;font-size:15px;line-height:1.4;white-space:pre-wrap;word-wrap:break-word}
.mh-bot-m{background:#f1f5f9;align-self:flex-start;border-bottom-left-radius:4px}.mh-user-m{background:var(--mh);color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.mh-sugg{display:flex;gap:6px;flex-wrap:wrap;padding:0 14px 8px}.mh-sugg button{border:1px solid var(--mh);color:var(--mh);background:#fff;border-radius:99px;padding:6px 12px;font-size:13px;cursor:pointer}
.mh-form{flex:0 0 auto;display:flex;gap:8px;padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom));border-top:1px solid #e2e8f0}.mh-form input{flex:1;padding:11px 14px;border:1px solid #cbd5e1;border-radius:99px;font-size:16px}
.mh-form button{width:44px;border:0;border-radius:50%;background:var(--mh);color:#fff;font-size:18px;cursor:pointer}.mh-form button:disabled{opacity:.5}
.mh-pow{flex:0 0 auto;text-align:center;font-size:11px;color:#94a3b8;padding:0 0 max(8px,env(safe-area-inset-bottom))}
.mh-typing{opacity:.6;font-style:italic}
/* v2 additions */
.mh-inline{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.mh-inline input{flex:1;min-width:160px;margin:0!important}
.mh-app textarea[readonly]{background:#f8fafc;font-family:ui-monospace,Menlo,monospace;font-size:12px}
.mh-app h4{margin:14px 0 6px}.mh-check{display:flex!important;gap:8px;align-items:center;font-weight:400!important}.mh-check input{width:auto!important;margin:0!important}
.mh-item{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid #f1f5f9;font-size:14px}.mh-item a{color:#0f766e;word-break:break-all}
.mh-x{background:none;border:0;color:#b91c1c;cursor:pointer;font-size:12px;white-space:nowrap}
.mh-dom{background:#f8fafc;border-radius:10px;padding:10px;margin:8px 0}
.mh-leadbtn{background:rgba(255,255,255,.2);color:#fff;border:1px solid rgba(255,255,255,.6);border-radius:99px;padding:6px 12px;font-size:12px;cursor:pointer;white-space:nowrap}
.mh-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.mh-lead{padding:12px 14px;background:#f8fafc;border-bottom:1px solid #e2e8f0}.mh-lead input:not([type=checkbox]),.mh-lead textarea{width:100%;padding:9px 11px;margin:5px 0;border:1px solid #cbd5e1;border-radius:10px;font:inherit;font-size:14px;box-sizing:border-box}
.mh-lead[hidden]{display:none}.mh-consent{display:flex;gap:6px;font-size:12px;color:#475569;align-items:flex-start;margin:6px 0}
.mh-leadrow{display:flex;gap:8px}.mh-leadrow button{flex:1;border:0;border-radius:10px;padding:9px;background:var(--mh);color:#fff;cursor:pointer;font-weight:600}.mh-leadrow button[type=button]{background:#e2e8f0;color:#0f172a}
#mh-lead-msg{font-size:12px;margin:6px 0 0;color:#b91c1c}#mh-lead-msg.ok{color:#15803d}
.mh-hosted .mh-hp{position:absolute;left:-9999px}
body.mh-embed .mh-chat{max-width:none;box-shadow:none}

/* Product thumbnails and safe clickable links in assistant replies */
.mh-chat-link{color:var(--mh);font-weight:600;text-decoration:underline;overflow-wrap:anywhere}.mh-thumb-link{display:block;width:100%;max-width:230px;margin:8px 0 5px;border-radius:12px;overflow:hidden}.mh-thumb{display:block;width:100%;height:auto;max-height:190px;object-fit:contain;background:#fff;border:1px solid #e2e8f0;border-radius:12px}.mh-bot-m a{cursor:pointer}

/* Native product cards: images and links are supplied by verified knowledge records. */
.mh-msgs>.mh-products{box-sizing:border-box;display:flex;flex:0 0 auto;flex-flow:row nowrap;gap:10px;width:100%;min-width:0;max-width:100%;margin:2px 0 12px;align-self:stretch;overflow-x:auto;overflow-y:hidden;padding:2px 2px 10px;overscroll-behavior-x:contain;touch-action:pan-x pan-y;scrollbar-width:thin;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
.mh-product-card{box-sizing:border-box;flex:0 0 min(72vw,184px);width:min(72vw,184px);min-width:0;max-width:184px;overflow:hidden;border:1px solid #e2e8f0;border-radius:13px;background:#fff;box-shadow:0 2px 7px rgba(15,23,42,.05);color:#0f172a;scroll-snap-align:start}
.mh-product-image{display:flex;align-items:center;justify-content:center;height:94px;background:#f8fafc;overflow:hidden}
.mh-product-image img{width:100%;height:100%;object-fit:contain;padding:7px}
.mh-product-image.mh-no-image{display:none}
.mh-product-body{padding:8px;display:flex;flex-direction:column;gap:5px;font-size:12px;line-height:1.3}
.mh-product-body strong{font-size:12px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.mh-product-body p{margin:0;color:#64748b;font-size:11px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mh-product-price{color:#0f766e;font-size:13px}.mh-product-cta{display:block;text-align:center;background:var(--mh);color:#fff!important;text-decoration:none;border-radius:8px;padding:7px 8px;font-weight:700;font-size:11px;margin-top:2px}
@media(min-width:600px){.mh-product-card{flex-basis:190px;width:190px;max-width:190px}.mh-product-image{height:112px}}

/* Compact fallback for products without a verified image */
.mh-product-image.mh-image-fallback{display:flex;align-items:center;justify-content:center;min-height:94px;color:#64748b;text-decoration:none;font-size:11px;font-weight:600;background:linear-gradient(135deg,#f1f5f9,#e2e8f0)}
.mh-product-image img{display:block}

.mh-guest-gate{margin-top:12px;padding:10px;border-radius:10px;background:#ecfdf5;color:#065f46;font-size:14px}.mh-note{font-size:13px;color:#64748b}

.mh-guest-gate{margin-top:12px;padding:10px;border-radius:10px;background:#ecfdf5;color:#065f46;font-size:14px}.mh-note{font-size:13px;color:#64748b}

/* v2.4.0: prevent product rails being squeezed/clipped by long chat histories and mobile viewport flex sizing */
.mh-msgs>*{flex-shrink:0}.mh-msgs>.mh-m{max-width:84%;min-width:0}.mh-msgs>.mh-products{order:initial}.mh-products::-webkit-scrollbar{height:4px}.mh-products::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:99px}.mh-product-card{align-self:stretch}.mh-product-image{flex:0 0 94px;min-height:94px}.mh-product-image img{max-width:100%;max-height:100%;object-fit:contain}
@supports(height:100svh){.mh-hosted,.mh-chat{height:100svh}}

/* v2.4.1: restore compact, independently swipeable product rail. */
.mh-msgs{align-items:stretch}
.mh-msgs>.mh-products{display:flex!important;flex:0 0 auto!important;align-self:stretch!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:auto!important;overflow-y:hidden!important;flex-wrap:nowrap!important;touch-action:pan-x!important;overscroll-behavior-x:contain!important;scroll-snap-type:x mandatory!important;padding:3px 2px 12px!important;margin:0 0 10px!important}
.mh-msgs>.mh-products>.mh-product-card{display:flex!important;flex:0 0 164px!important;width:164px!important;min-width:164px!important;max-width:164px!important;flex-direction:column!important;scroll-snap-align:start!important}
.mh-msgs>.mh-products .mh-product-image{height:112px!important;min-height:112px!important;flex:0 0 112px!important}
.mh-msgs>.mh-products .mh-product-image img{width:100%!important;height:100%!important;object-fit:contain!important}
.mh-msgs>.mh-products .mh-product-body{min-width:0!important}
@media(min-width:600px){.mh-msgs>.mh-products>.mh-product-card{flex-basis:184px!important;width:184px!important;min-width:184px!important;max-width:184px!important}}
