/* Bản triển lãm: thanh điều khiển demo, lời dẫn, màn hình kết. */
html.expo #to-classic, html.expo .st-head .chip-warn { display: none !important; }
.xp-card { position: fixed; z-index: 70; left: 16px; bottom: 16px; width: clamp(260px, calc((100vw - 820px) / 2 - 30px), 440px); background: #10201d; color: #fff; border-radius: 18px; padding: 14px 16px 12px; box-shadow: 0 14px 40px rgba(10,30,25,.35); display: grid; gap: 8px; }
@media (max-width: 1380px) { .xp-card { bottom: auto; top: 132px; left: auto; right: 16px; width: 320px; } }
.xp-step { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .08em; color: #9fd6cb; }
.xp-step b { font-size: 13px; color: #fff; }
.xp-dots { display: flex; gap: 5px; margin-left: auto; }
.xp-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); }
.xp-dots i.on { background: #6fe0cd; }
.xp-ttl { font-size: 19px; line-height: 1.35; font-weight: 700; }
html[lang="ja"] .xp-ttl { font-family: var(--font-display-ja); }
.xp-cap { font-size: 14px; line-height: 1.6; color: #d6e6e2; }
.xp-ctl { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.xp-ctl button { white-space: nowrap; flex: none; height: 34px; min-width: 34px; padding: 0 10px; border-radius: 9px; background: rgba(255,255,255,.12); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.xp-ctl button:hover { background: rgba(255,255,255,.22); }
.xp-ctl button.on { background: #6fe0cd; color: #10201d; }
.xp-ctl svg { width: 16px; height: 16px; }
.xp-ctl .keys { white-space: nowrap; overflow: hidden; margin-left: auto; font-size: 11px; color: #8fb1aa; }
.xp-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; background: #6fe0cd; }
.xp-bar i.run { transition: width linear; }
.xp-pulse { outline: 3px solid var(--shu); outline-offset: 3px; border-radius: 10px; animation: xp-pulse .5s ease-in-out 3; }
@keyframes xp-pulse { 50% { outline-offset: 7px; } }
@media (prefers-reduced-motion: reduce) { .xp-pulse { animation: none; } }

.xp-end { position: fixed; inset: 0; z-index: 90; background: #0e1f1c; color: #fff; display: grid; place-items: center; padding: 4vh 5vw; overflow: auto; }
.xp-end[hidden] { display: none; }
.xp-end .in { width: min(1200px, 100%); display: grid; gap: 4vh; }
.xp-end h2 { font-size: clamp(30px, 4.2vw, 60px); line-height: 1.25; }
.xp-end .pts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .xp-end .pts { grid-template-columns: minmax(0, 1fr); } }
.xp-end .pt { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 22px; display: grid; gap: 10px; align-content: start; }
.xp-end .pt svg { width: 30px; height: 30px; color: #6fe0cd; }
.xp-end .pt b { font-size: clamp(19px, 1.8vw, 28px); line-height: 1.4; }
.xp-end .pt > span { font-size: clamp(14px, 1.15vw, 17px); line-height: 1.7; color: #cfe1dd; }
.xp-end .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.xp-end .who { font-size: clamp(16px, 1.4vw, 21px); line-height: 1.7; color: #cfe1dd; flex: 1; min-width: 280px; }
.xp-end .who b { color: #fff; font-size: 1.3em; }
.xp-qr { display: grid; gap: 8px; justify-items: center; font-size: 15px; color: #cfe1dd; }
.xp-qr .box { background: #fff; padding: 10px; border-radius: 12px; line-height: 0; }
.xp-qr svg { width: 148px; height: 148px; }
.xp-end .again { height: 46px; padding: 0 20px; border-radius: 12px; background: #6fe0cd; color: #10201d; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.xp-end .again svg { width: 18px; height: 18px; }
/* Bản triển lãm: thu gọn khung chat (ẩn lịch sử, chỉ còn gợi ý + ô nhập) để không che nội dung chính. Bấm "履歴" để mở lại. */
html.expo .convo:not(.open) .cv-log { display: none; }
html.expo .st-body { padding-bottom: 200px; }

/* ===== Cảnh dẫn (chữ lớn cho người đứng xa tivi): mở đầu, câu hỏi, AI đang làm việc ===== */
.xp-scene { position: fixed; inset: 0; z-index: 66; background: rgba(12,28,25,.94); backdrop-filter: blur(10px); color: #fff; display: grid; place-items: center; padding: 5vh 6vw 22vh; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.xp-scene.on { opacity: 1; pointer-events: auto; }
.xp-scene .in { width: min(1250px, 100%); display: grid; gap: 3.2vh; }
.xp-chap { display: flex; align-items: baseline; gap: 1.4vw; }
.xp-chap .no { font-size: clamp(15px, 1.4vw, 22px); letter-spacing: .18em; color: #6fe0cd; font-weight: 700; }
.xp-chap h2 { font-size: clamp(30px, 4.4vw, 68px); line-height: 1.25; }
.xp-say { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.4vw; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 22px; padding: 2.2vh 2vw; }
.xp-say .mic { width: clamp(46px, 4.2vw, 68px); height: clamp(46px, 4.2vw, 68px); border-radius: 50%; background: #17756a; display: grid; place-items: center; position: relative; }
.xp-say .mic svg { width: 45%; height: 45%; }
.xp-say .mic::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #6fe0cd; opacity: 0; }
.xp-say.talk .mic::after { animation: xp-ring 1s ease-out infinite; }
@keyframes xp-ring { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
.xp-say .q { font-size: clamp(22px, 2.9vw, 44px); font-weight: 700; line-height: 1.4; min-height: 1.4em; }
.xp-say .q::after { content: "▍"; color: #6fe0cd; margin-left: 2px; animation: xp-blink 1s steps(2) infinite; }
.xp-say.sent .q::after { display: none; }
@keyframes xp-blink { 50% { opacity: 0; } }
.xp-work { display: grid; gap: 1.3vh; padding-left: .4vw; }
.xp-work .ln { display: grid; grid-template-columns: clamp(24px, 2vw, 32px) minmax(0, 1fr); gap: 1vw; align-items: center; font-size: clamp(17px, 1.9vw, 29px); color: #cfe1dd; opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; }
.xp-work .ln.show { opacity: 1; transform: none; }
.xp-work .ln .st { width: clamp(22px, 1.8vw, 30px); height: clamp(22px, 1.8vw, 30px); border-radius: 50%; border: 3px solid rgba(111,224,205,.3); border-top-color: #6fe0cd; animation: xp-spin .8s linear infinite; }
.xp-work .ln.done { color: #fff; }
.xp-work .ln.done .st { animation: none; border: 0; background: #6fe0cd; position: relative; }
.xp-work .ln.done .st::after { content: ""; position: absolute; left: 34%; top: 18%; width: 28%; height: 50%; border: solid #10201d; border-width: 0 3px 3px 0; transform: rotate(45deg); }
@keyframes xp-spin { to { transform: rotate(360deg); } }
.xp-work .ln code { font-family: ui-monospace, Menlo, monospace; font-size: .62em; color: #7fb9ae; margin-left: .8em; }

/* Cảnh mở đầu */
.xp-intro { display: grid; gap: 4vh; }
.xp-intro .l { font-size: clamp(26px, 3.6vw, 56px); line-height: 1.35; opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.xp-intro .l.show { opacity: 1; transform: none; }
.xp-intro .l.ans { color: #6fe0cd; }
.xp-load { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4vw; }
.xp-load .c { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 2.2vh 1.5vw; opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .45s ease, transform .45s ease; }
.xp-load .c.show { opacity: 1; transform: none; }
.xp-load .c b { display: block; white-space: nowrap; font-size: clamp(30px, 4.1vw, 66px); line-height: 1.05; font-variant-numeric: tabular-nums; color: #ffb199; }
.xp-load .c b small { font-size: .36em; margin-left: .15em; color: #fff; }
.xp-load .c > span { font-size: clamp(14px, 1.35vw, 21px); color: #cfe1dd; }

/* Màn hình hiện ra: các khối xuất hiện lần lượt, phần quan trọng được khoanh sáng */
html.expo .st-body .enter > * { animation: xp-rise .55s ease both; }
html.expo .st-body .enter > *:nth-child(2) { animation-delay: .18s; }
html.expo .st-body .enter > *:nth-child(3) { animation-delay: .36s; }
html.expo .st-body .enter > *:nth-child(4) { animation-delay: .54s; }
@keyframes xp-rise { from { opacity: 0; transform: translateY(18px); } }
.xp-focus { outline: 4px solid #17a892; outline-offset: 4px; border-radius: 12px; animation: xp-focus 1.1s ease-in-out 2; }
@keyframes xp-focus { 50% { outline-offset: 10px; outline-color: rgba(23,168,146,.45); } }
@media (prefers-reduced-motion: reduce) { html.expo .st-body .enter > *, .xp-focus, .xp-work .ln .st { animation: none; } }

/* Thẻ lời dẫn: chữ to hơn */
.xp-ttl { font-size: clamp(19px, 1.5vw, 25px); }
.xp-cap { font-size: clamp(14px, 1.05vw, 17px); }

/* Màn hình kết: những việc AI đã làm trong demo */
.xp-end .in { gap: 3vh; }
.xp-end h2 { font-size: clamp(28px, 3.8vw, 58px); }
.xp-end .lbl { font-size: clamp(14px, 1.3vw, 20px); letter-spacing: .12em; color: #6fe0cd; font-weight: 700; }
.xp-tally { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .xp-tally { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.xp-tally .t { border-left: 3px solid #6fe0cd; padding: .4vh 0 .4vh 1vw; }
.xp-tally .t b { display: block; font-size: clamp(34px, 4.6vw, 72px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.xp-tally .t b small { font-size: .36em; margin-left: .15em; }
.xp-tally .t > span { font-size: clamp(13px, 1.15vw, 18px); color: #cfe1dd; line-height: 1.5; display: block; margin-top: .6vh; }
.xp-end .pt { padding: 16px 18px; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
.xp-end .pt svg { grid-row: span 2; width: 28px; height: 28px; margin-top: 3px; }
.xp-end .pt b { font-size: clamp(16px, 1.45vw, 22px); }
.xp-end .pt > span { font-size: clamp(13px, 1.05vw, 16px); }

/* ===== Màn hình nhà máy: nguồn dữ liệu, thẻ agent, chuỗi nguyên nhân, bảng tồn kho ===== */
.fx-srcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.fx-src { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-items: center; background: #f6f8f7; border-radius: 10px; padding: 9px 12px; }
.fx-src svg { grid-row: span 2; width: 20px; height: 20px; color: var(--wakatake); }
.fx-src b { font-size: 13.5px; line-height: 1.3; }
.fx-src > span { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fx-agents { grid-column: span 12; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1180px) { .fx-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .fx-agents { grid-template-columns: minmax(0, 1fr); } }
.fx-agent { background: var(--surface); border: 1px solid #dfe5e3; border-radius: 14px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.fx-agent .hd { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.fx-agent .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--wakatake-soft); color: var(--wakatake); display: grid; place-items: center; }
.fx-agent .ic svg { width: 20px; height: 20px; }
.fx-agent .hd b { display: block; font-size: 15.5px; line-height: 1.3; }
.fx-agent .src { display: block; font-size: 11.5px; color: var(--ink-3); }
.fx-agent .did { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.fx-agent .found .chip { font-size: 13px; padding: 3px 10px; }
.fx-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ok); white-space: nowrap; }
.fx-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: fx-live 1.6s ease-in-out infinite; }
@keyframes fx-live { 50% { opacity: .25; } }
.fx-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.fx-chain .n { flex: 1; min-width: 190px; border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; border: 1px solid; }
.fx-chain .n.bad { background: var(--bad-soft); border-color: #f3c4bf; }
.fx-chain .n.warn { background: var(--warn-soft); border-color: #ecd4a6; }
.fx-chain .n small { font-size: 11.5px; color: var(--ink-2); letter-spacing: .06em; }
.fx-chain .n b { font-size: 14.5px; line-height: 1.4; }
.fx-chain > svg { width: 20px; height: 20px; align-self: center; color: var(--ink-3); flex: none; }
.fx-bar { display: block; height: 8px; border-radius: 4px; background: #e9eeec; overflow: hidden; min-width: 60px; }
.fx-bar i { display: block; height: 100%; border-radius: 4px; }
.fx-brow { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 3.4em; gap: 10px; align-items: center; font-size: 13.5px; padding: 4px 0; }
.fx-brow b { text-align: right; }
.fx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #edf0ef; font-size: 13.5px; }
.fx-row:first-child { border-top: 0; padding-top: 0; }
.fx-row small, .fx-tr small { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.fx-tbl { display: grid; }
.fx-th, .fx-tr { display: grid; grid-template-columns: 1.1fr .6fr .8fr 1.3fr 1.9fr; gap: 14px; align-items: center; }
.fx-th { font-size: 12px; color: var(--ink-3); padding-bottom: 6px; }
.fx-tr { padding: 12px 0; border-top: 1px solid #edf0ef; font-size: 14px; }
.fx-tr.done-row { opacity: .75; }
.fx-days { display: grid; gap: 4px; }
.fx-days b { font-size: 17px; }
.fx-act { display: grid; gap: 6px; justify-items: start; }
@media (max-width: 1000px) { .fx-th { display: none; } .fx-tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .fx-act { grid-column: span 2; } }
.fx-order { padding: 12px 0; border-top: 1px solid #edf0ef; }
.fx-order:first-of-type { border-top: 0; padding-top: 0; }
.fx-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.fx-why .chip svg { width: 13px; height: 13px; }
@media (prefers-reduced-motion: reduce) { .fx-live i { animation: none; } }

/* Màn hình rộng: dành chỗ bên trái cho thẻ lời dẫn để không che nội dung. */
@media (min-width: 1381px) { html.expo .st-body { max-width: none; margin: 0; padding-left: calc(clamp(260px, calc((100vw - 820px) / 2 - 30px), 440px) + 36px); padding-right: 24px; padding-bottom: 230px; } }

@media (min-width: 1381px) { .fx-agents { grid-template-columns: repeat(4, minmax(0, 1fr)); } .fx-agent .hd { grid-template-columns: 40px minmax(0, 1fr); } .fx-agent .fx-live { display: none; } }
