/* Live product demos (.mx): the app window rebuilt in HTML so the text stays sharp.
   Designed at 800 x 500 and scaled to fit its container with --s (set from JS).
   Colours are the app's own dark theme tokens. */

.feature-visual { position: relative; }

.mxbox { --s: 1; position: relative; width: 100%; aspect-ratio: 8 / 5; overflow: hidden; background: #0e1117; }
.mx { position: absolute; left: 0; top: 0; width: 800px; height: 500px; zoom: var(--s); display: flex; flex-direction: column; font: 400 11px/1.45 "Barlow", system-ui, sans-serif; color: #fff; user-select: none; }
.mx svg { display: block; width: 100%; height: 100%; }
.mx ul { margin: 0; padding: 0; list-style: none; }
.mx h4, .mx h5, .mx p { margin: 0; }

.mx-titlebar { flex: none; height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: #1b1b1b; font: 500 10.5px/1 "Barlow", sans-serif; color: #a9b2c3; }
.mx-titlebar img, .mx-logo img { border-radius: 3px; }
.mx-wc { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.mx-wc b { display: block; width: 8px; height: 1.4px; background: #8a9bb8; }
.mx-wc b:nth-child(2) { height: 8px; background: none; border: 1.4px solid #8a9bb8; box-sizing: border-box; }
.mx-wc b:nth-child(3) { height: 8px; background: linear-gradient(45deg, transparent 45%, #8a9bb8 45% 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #8a9bb8 45% 55%, transparent 55%); }
.mx-body { flex: 1; min-height: 0; display: flex; position: relative; }

.mx-side { width: 150px; flex: none; background: #161b24; border-right: 1px solid rgba(255, 255, 255, 0.06); padding: 12px 10px 10px; display: flex; flex-direction: column; }
.mx-logo { display: flex; align-items: center; gap: 6px; font: 700 14px/1 "Barlow Condensed", sans-serif; margin-bottom: 14px; }
.mx-new { display: flex; align-items: center; justify-content: center; gap: 5px; height: 24px; border-radius: 12px; background: #2e77d0; font: 700 11px/1 "Barlow Condensed", sans-serif; }
.mx-new svg { width: 10px; height: 10px; }
.mx-hist-label { margin: 14px 4px 5px; font: 500 8.5px/1 "Barlow", sans-serif; letter-spacing: 0.9px; color: #3e4d63; }
.mx-hist { flex: 1; display: grid; align-content: start; gap: 1px; overflow: hidden; }
.mx-hist li { display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; border-radius: 6px; color: #8a9bb8; font-size: 10px; white-space: nowrap; }
.mx-hist li svg { width: 10px; height: 10px; flex: none; }
.mx-hist li span { overflow: hidden; text-overflow: ellipsis; }
.mx-hist li time { margin-left: auto; font-size: 8.5px; color: #3e4d63; flex: none; }
.mx-hist li.is-active { background: rgba(46, 119, 208, 0.14); color: #6fb0f5; }
.mx-settings { display: flex; align-items: center; gap: 6px; padding: 8px 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); color: #8a9bb8; font-size: 10.5px; }
.mx-settings svg { width: 11px; height: 11px; }

.mx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #0e1117; position: relative; }
.mx-head { flex: none; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.mx-back { width: 11px; height: 11px; color: #8a9bb8; }
.mx-head .mx-title { margin: 0 auto 0 4px; font: 700 14px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.1px; }
.mx-credits { height: 20px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1); background: #161b24; font: 600 10px/1 "Barlow", sans-serif; transition: box-shadow 300ms ease, border-color 300ms ease; }
.mx-credits b { font-weight: 600; margin-right: 3px; font-variant-numeric: tabular-nums; }
.mx-credits.pulse { border-color: rgba(111, 176, 245, 0.7); box-shadow: 0 0 14px rgba(46, 119, 208, 0.55); }
.mx-ibtn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.1); background: #161b24; display: grid; place-items: center; padding: 5px; color: #cbd5e6; transition: transform 160ms ease, background 160ms ease; }
.mx-ibtn.is-press { transform: scale(0.88); background: #252d3d; }

.mx-chat { flex: 1; min-height: 0; position: relative; padding: 14px 70px 0; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.mx-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #8a9bb8; font-size: 12px; }
.mx-empty[hidden] { display: none; }
.mx-msg.user { align-self: flex-end; max-width: 78%; padding: 8px 12px; border-radius: 14px; background: #1e2533; font-size: 11px; line-height: 1.45; }
.mx-msg.bot { display: flex; gap: 10px; }
.mx-av { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #2e77d0; display: grid; place-items: center; padding: 4px; margin-top: 1px; }
.mx-text { position: relative; min-width: 0; font-size: 11px; line-height: 1.5; color: #eceded; }
.mx-text p { margin: 0 0 6px; }
.mx-text ul { margin: 0 0 6px; padding-left: 16px; list-style: disc; }
.mx-text li { margin: 0 0 3px; padding-left: 2px; }
.mx-text strong { font-weight: 700; color: #fff; }
.mx-text code { font: 500 10px/1 "JetBrains Mono", ui-monospace, Consolas, monospace; padding: 2px 5px; border-radius: 4px; background: #1e2533; border: 1px solid rgba(255, 255, 255, 0.08); }
.mx-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 9.5px; color: #8a9bb8; transition: opacity 400ms ease; }
.mx-meta b { font-weight: 500; }
.mx-meta i { width: 10px; height: 10px; display: block; margin-left: 3px; }
.mx-dots { position: absolute; left: 0; top: 4px; display: flex; gap: 4px; }
.mx-dots[hidden] { display: none; }
.mx-dots b { width: 5px; height: 5px; border-radius: 50%; background: #8a9bb8; animation: blink 1.2s ease-in-out infinite; }
.mx-dots b:nth-child(2) { animation-delay: 0.15s; }
.mx-dots b:nth-child(3) { animation-delay: 0.3s; }

.mx-composer { flex: none; padding: 0 70px 6px; }
.mx-field { border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.1); background: #1e2533; padding: 9px 11px 7px; min-height: 52px; }
.mx-input { display: block; min-height: 16px; font-size: 11px; color: #fff; white-space: nowrap; overflow: hidden; }
.mx-input:empty::before { content: attr(data-ph); color: #6b7a93; }
.mx-input.is-typing::after { content: ""; display: inline-block; width: 1px; height: 11px; margin-left: 1px; background: #6fb0f5; vertical-align: -2px; animation: caret 900ms steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.mx-tools { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: #5b79a8; }
.mx-tools > span { width: 11px; height: 11px; display: block; }
.mx-model { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 17px; padding: 0 8px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.12); font: 500 9.5px/1 "Barlow", sans-serif; font-style: normal; color: #eceded; }
.mx-model svg { width: 9px; height: 9px; }
.mx-tools .mx-send { width: 18px; height: 18px; border-radius: 50%; background: rgba(46, 119, 208, 0.28); color: rgba(255, 255, 255, 0.45); display: grid; place-items: center; padding: 4px; transition: background 200ms ease, color 200ms ease, transform 160ms ease; }
.mx-tools .mx-send.live { background: #2e77d0; color: #fff; }
.mx-tools .mx-send.is-press { transform: scale(0.85); }
.mx-hint { margin-top: 4px; text-align: right; font-size: 8.5px; color: #3e4d63; }

/* workspace panel */
.mx-scrim { display: none; position: absolute; inset: 0; z-index: 4; background: rgba(5, 8, 12, 0.6); }
.mx-modal { display: none; position: absolute; z-index: 5; left: 50%; top: 6px; width: 272px; padding: 12px; border-radius: 12px; background: #1e2533; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7); transform: translateX(-50%); }
.mx-scrim.on { display: block; animation: mxFade 260ms ease both; }
.mx-modal.on { display: block; animation: mxModal 340ms var(--ease) both; }
@keyframes mxFade { from { opacity: 0; } }
@keyframes mxModal { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.97); } }
.mx-mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mx-mhead h5 { font: 700 14px/1 "Barlow Condensed", sans-serif; }
.mx-close { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); display: grid; place-items: center; padding: 4px; color: #fff; transition: transform 160ms ease; }
.mx-close.is-press { transform: scale(0.85); }
.mx-mlabel { margin: 8px 0 5px; font: 600 8.5px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.9px; color: #6f86ab; }
.mx-roots { display: grid; gap: 5px; }
.mx-roots li { display: flex; align-items: center; justify-content: space-between; padding: 6px 9px; border-radius: 8px; background: #161b24; border: 1px solid rgba(255, 255, 255, 0.06); }
.mx-roots li.is-new { display: none; }
.mx-roots li.is-new.on { display: flex; }
.mx-roots li.flash { animation: mxFlash 1.6s ease both; }
@keyframes mxFlash { 0% { opacity: 0; transform: translateY(-6px); } 20% { opacity: 1; transform: none; box-shadow: 0 0 0 1px #6fb0f5, 0 0 16px rgba(46, 119, 208, 0.6); } 100% { box-shadow: 0 0 0 0 transparent; } }
.mx-roots strong { display: block; font-size: 10.5px; font-weight: 700; }
.mx-roots code { font: 500 9px/1.3 "JetBrains Mono", ui-monospace, Consolas, monospace; color: #8a9bb8; }
.mx-ract { display: flex; align-items: center; gap: 5px; }
.mx-ract span { font-size: 9px; padding: 4px 8px; border-radius: 6px; color: #e08a9a; background: rgba(224, 138, 154, 0.1); border: 1px solid rgba(224, 138, 154, 0.2); }
.mx-rfold { width: 22px; height: 21px; padding: 4px 5px; border-radius: 6px; background: #161b24; border: 1px solid rgba(255, 255, 255, 0.1); color: #cbd5e6; display: block; }
.mx-browser { padding: 8px; border-radius: 8px; background: #161b24; border: 1px solid rgba(255, 255, 255, 0.06); }
.mx-path { display: flex; gap: 5px; }
.mx-path span { flex: 1; padding: 4px 7px; border-radius: 6px; background: #0e1117; border: 1px solid rgba(255, 255, 255, 0.1); font: 500 10px/1.2 "JetBrains Mono", ui-monospace, Consolas, monospace; }
.mx-path em { font-style: normal; font-size: 9.5px; padding: 4px 8px; border-radius: 6px; background: #252d3d; border: 1px solid rgba(255, 255, 255, 0.1); }
.mx-up { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; font: 500 9.5px/1 "JetBrains Mono", ui-monospace, Consolas, monospace; color: #8a9bb8; }
.mx-up i { width: 16px; height: 16px; border-radius: 5px; background: #252d3d; border: 1px solid rgba(255, 255, 255, 0.1); padding: 3px; color: #fff; display: block; }
.mx-entries { border-top: 1px solid rgba(255, 255, 255, 0.06); min-height: 104px; }
.mx-entries li { display: flex; align-items: center; justify-content: space-between; height: 21px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 10px; }
.mx-ename { display: flex; align-items: center; gap: 5px; padding-left: 4px; transition: color 160ms ease; }
.mx-ename svg { width: 11px; height: 11px; }
.mx-eadd { font-size: 9px; padding: 2px 7px; border-radius: 5px; background: #252d3d; border: 1px solid rgba(255, 255, 255, 0.12); }
.mx-entries li.is-press .mx-ename { color: #6fb0f5; }
.mx-addhere { margin-top: 7px; display: inline-block; padding: 5px 10px; border-radius: 7px; background: #2e77d0; font-size: 10px; font-weight: 600; transition: transform 160ms ease; }
.mx-addhere.is-press { transform: scale(0.95); }

/* cursor */
.mx-cursor { position: absolute; left: 0; top: 0; z-index: 9; width: 15px; height: 15px; pointer-events: none; opacity: 0; transform: translate(var(--cx, 560px), var(--cy, 430px)); transition: transform 800ms cubic-bezier(0.45, 0, 0.2, 1), opacity 250ms ease; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.mx-cursor.on { opacity: 1; }
.mx-cursor svg { transition: transform 120ms ease; transform-origin: 20% 10%; }
.mx-cursor.press svg { transform: scale(0.82); }

/* Animation states, active only while a scene is playing (.is-anim on the holder). */
.is-anim [data-step]:not(.on) { display: none; }
.is-anim [data-step].on { animation: mxIn 420ms var(--ease) both; }
@keyframes mxIn { from { opacity: 0; transform: translateY(6px); } }
.is-anim [data-hist]:not(.on) { display: none; }
.is-anim [data-hist].on { animation: mxIn 420ms var(--ease) both; }
.is-anim .w:not(.on) { opacity: 0; }
.is-anim .w { transition: opacity 180ms ease; }
.is-anim [data-stream] :is(p, ul, li):not(.on) { visibility: hidden; }
.is-anim [data-meta]:not(.on) { opacity: 0; }
/* the panel and its backdrop have their own entrance, not the generic one */
.is-anim .mx-modal:not(.on), .is-anim .mx-scrim:not(.on) { display: none; }
.is-anim .mx-modal.on { animation: mxModal 340ms var(--ease) both; }
.is-anim .mx-scrim.on { animation: mxFade 260ms ease both; }
.is-anim .mx-roots li.is-new:not(.on) { display: none; }

@media (max-width: 960px) {
  }

/* loop: the demo fades out, rewinds, and fades back in */
.appwin, .usage { transition: opacity 500ms ease, transform 500ms var(--ease); }
.appwin.is-out, .usage.is-out { opacity: 0; }
