/* The AI mystery shopping page (/ai-mystery-shopping; server/shopping-page.js). Builds on the
   Visibility page (app.css, visibility.css) and KNWN's drawn screens (product-ui.css): the study's
   table is drawn in --u units like the other screens, so it scales while its words stay sharp. */

/* The study in the app's window, and one shopper's card in front of it. */
.shop-stage, [dir='rtl'] .shop-stage { padding: 0; padding-inline-end: clamp(0px, 12vw, 160px); }
.shop-window { position: relative; overflow: hidden; border-radius: 18px; box-shadow: 0 0 0 .5px #19191b24, 0 40px 80px -36px #3a2a7a66, 0 16px 32px -20px #19191b40; }
/* The table reads left to right in every language, so a phone's crop keeps its left edge. */
.kui--study { --w: 980; direction: ltr; }
.kui-study-body { padding: calc(20 * var(--u)) calc(24 * var(--u)) calc(24 * var(--u)); background: #f2f3f6; }
.kui-study-title { display: flex; align-items: center; gap: calc(10 * var(--u)); margin-bottom: calc(14 * var(--u)) !important; font-size: calc(22 * var(--u)); letter-spacing: -.02em; }
.kui-study-title b { font-weight: 700; }
.kui--study .kui-card { padding: calc(18 * var(--u)) 0 calc(14 * var(--u)); }
.kui--study .kui-card-head { padding: 0 calc(18 * var(--u)); }
.kui--study table { margin-top: calc(14 * var(--u)); font-size: calc(13 * var(--u)); }
.kui--study th { white-space: nowrap; }
.kui--study thead th:not(:first-child) { text-align: end; }
.kui--study tbody th { padding: calc(10 * var(--u)) calc(18 * var(--u)); border-top: calc(1 * var(--u)) solid #efeff3; background: none; color: #19191b; font-size: calc(13 * var(--u)); font-weight: 550; }
.kui--study td { padding: calc(6 * var(--u)) calc(14 * var(--u)); text-align: end; }
.kui--study thead .kui-engine { justify-content: flex-end; gap: calc(6 * var(--u)); }
.kui--study .kui-plain-row th, .kui--study .kui-plain-row td { background: #fafafc; }
.kui-cell { display: inline-flex; min-width: calc(96 * var(--u)); flex-direction: column; align-items: flex-end; padding: calc(6 * var(--u)) calc(10 * var(--u)); border-radius: calc(8 * var(--u)); }
.kui-cell strong { font-size: calc(15 * var(--u)); font-variant-numeric: tabular-nums; }
.kui-cell small { margin-top: calc(1 * var(--u)); font-size: calc(11 * var(--u)); }
.kui-cell--less { background: #fdecec; color: #a5302f; box-shadow: inset 0 0 0 calc(.8 * var(--u)) #f5c9c8; }
.kui-cell--less small { color: #a5302fb3; }
.kui-study-legend { display: flex; flex-wrap: wrap; gap: calc(16 * var(--u)); margin: calc(12 * var(--u)) calc(18 * var(--u)) 0 !important; color: #55545e; font-size: calc(11.5 * var(--u)); }
.kui-study-legend span { display: inline-flex; align-items: center; gap: calc(6 * var(--u)); }
.kui-study-legend i { width: calc(10 * var(--u)); height: calc(10 * var(--u)); border-radius: calc(3 * var(--u)); background: #eceef2; }
.kui-study-legend .kui-dot--less { background: #f5c9c8; }
.kui-study-legend .kui-dot--more { background: #bfe3cf; }

.shop-float { width: clamp(280px, 38%, 430px); bottom: -18%; }
.kui--verdict .kui-card-head { align-items: center; }
.kui-tag--less { background: #fdecec; color: #a5302f; box-shadow: inset 0 0 0 calc(.8 * var(--u)) #f5c9c8; }
.kui-meter--less b { background: #c2413f; }
.kui-instead { display: flex; align-items: baseline; justify-content: space-between; gap: calc(12 * var(--u)); margin-top: calc(12 * var(--u)) !important; padding-top: calc(12 * var(--u)); border-top: calc(1 * var(--u)) solid #efeff3; font-size: calc(13.5 * var(--u)); }
.kui-instead small { margin: 0; }
.shop-hero .vis-caption { margin-top: clamp(64px, 8vw, 96px); }

/* Two tests: the same question from a shopper and from anyone; an AI agent on a store. */
.shop-two { margin-top: clamp(56px, 8vw, 96px); }
.shop-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.shop-tile { padding: 0 0 26px; }
.shop-tile > :not(.shop-art) { margin-inline: 26px; }
.shop-tile h3 { margin-top: 22px; }
.shop-art { display: flex; height: 350px; align-items: center; justify-content: center; padding: 26px; background: var(--lavender-soft); }
.shop-art p, .shop-art ol { margin: 0; padding: 0; list-style: none; }

.shop-ask { display: grid; width: 100%; max-width: 480px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shop-ask-col { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 14px; border-radius: 18px; background: #fff; box-shadow: var(--card); }
.shop-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; }
.shop-who b { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.shop-avatar { display: inline-grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.shop-ask-col--plain .shop-avatar { background: none; box-shadow: inset 0 0 0 1.5px #b9b6c2; border: 0; }
.shop-art .shop-bubble { padding: 9px 11px; border-radius: 14px 14px 14px 4px; background: #f3f2f6; color: #36333c; font-size: 12px; line-height: 1.45; }
[dir='rtl'] .shop-bubble { border-radius: 14px 14px 4px 14px; }
.shop-art .shop-first { padding: 7px 10px; border-radius: 10px; background: #fdecec; color: #a5302f; font-size: 12px; font-weight: 650; }
.shop-first.is-you { background: #efedf8; color: var(--accent-dark); }

.shop-store { display: grid; width: 100%; max-width: 420px; gap: 14px; }
.shop-browser { overflow: hidden; border-radius: 16px; background: #fff; box-shadow: var(--pop); direction: ltr; text-align: left; }
.shop-art .shop-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid #efedf3; background: #f6f5f9; }
.shop-bar i { width: 8px; height: 8px; border-radius: 50%; background: #dcdae2; }
.shop-bar span { margin: 0 auto; color: #75727e; font-size: 11px; }
.shop-product { position: relative; display: flex; gap: 14px; padding: 16px; }
.shop-bag { position: relative; display: block; width: 86px; height: 96px; flex: none; border-radius: 12px; background: linear-gradient(160deg, #e9c99a, #c98f4f); }
.shop-bag i { position: absolute; inset: 22% 22% 30%; border-radius: 6px; background: #fff6e8cc; }
.shop-product b { display: block; font-size: 14px; font-weight: 650; }
.shop-product small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.shop-cart { position: relative; display: inline-flex; margin-top: 12px; padding: 7px 12px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.shop-pointer { position: absolute; left: 14px; bottom: -14px; width: 20px; height: 20px; }
/* A sign-up pop-up over the cart button: the step the agent got stuck on. */
.shop-popup { position: absolute; z-index: 1; top: 62px; left: 172px; display: grid; gap: 6px; width: 112px; padding: 12px 10px 10px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px #19191b14, 0 12px 26px -10px #19191b66; }
.shop-popup i { display: block; height: 6px; border-radius: 3px; background: #e7e4ed; }
.shop-popup i + i { width: 70%; }
.shop-popup b { display: block; height: 18px; margin-top: 2px; border-radius: 6px; background: var(--accent); }
.shop-chips { display: grid; gap: 6px; }
.shop-chips li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: #fff; font-size: 12.5px; font-weight: 600; box-shadow: var(--card); }
.shop-chips svg, .shop-run svg, .shop-credits svg { width: 14px; height: 14px; flex: none; }
.is-pass > svg, .is-pass em svg { color: #2f8a6b; }
.is-fail > svg, .is-fail em svg { color: #c2413f; }

/* The panels: words beside their picture. */
.shop-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.shop-copy > p { margin-top: 14px; color: #48454e; font-size: 15.5px; line-height: 1.75; }
.shop-copy > h2 + p { margin-top: 18px; }
.shop-copy .vis-links { margin-top: 22px; }
.shop-credits { display: grid; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.shop-credits li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--surface); font-size: 14px; font-weight: 550; box-shadow: var(--card); }
.shop-credits li > svg { color: var(--accent); stroke-width: 2.6; }
.shop-credits li.is-out { color: var(--muted); }
.shop-credits li.is-out > svg { color: #9a98a3; }

.shop-people { padding: 22px; border-radius: 22px; background: #fff; box-shadow: var(--pop); }
.shop-people p, .shop-people ul { margin: 0; padding: 0; list-style: none; }
.shop-people-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; font-size: 14px; }
.shop-people-head b { font-weight: 650; }
.shop-people-head span { color: var(--muted); font-size: 13px; }
.shop-dots { display: grid; grid-template-columns: repeat(25, minmax(0, 1fr)); gap: 4px; margin-top: 16px; }
.shop-dots i { aspect-ratio: 1; border-radius: 50%; background: #dcd4f3; }
.shop-dots i.is-picked { background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--accent); }
.shop-key { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px !important; color: #48454e; font-size: 12.5px; }
.shop-key span { display: inline-flex; align-items: center; gap: 7px; }
.shop-key i { width: 10px; height: 10px; border-radius: 50%; background: #dcd4f3; }
.shop-shoppers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px !important; padding-top: 16px !important; border-top: 1px solid #f0eef4; }
.shop-shoppers li { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--lavender-soft); font-size: 12px; font-weight: 600; }
[dir='rtl'] .shop-shoppers li { padding: 4px 4px 4px 10px; }
.shop-shoppers .shop-avatar { width: 22px; height: 22px; flex-basis: 22px; font-size: 11px; }

/* Journey Mapping: the store's report on the dark panel. */
.shop-journey h2 { color: #fff; }
.shop-journey .resource-kicker { color: #d9cffb; }
.shop-journey .shop-copy > p { color: #ffffffc7; }
.shop-light { color: #d9cffb; }
.shop-report { margin: 0; padding: 22px; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 0 30px 60px -30px #000000b3; }
.shop-report p, .shop-report ol { margin: 0; padding: 0; list-style: none; }
.shop-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shop-report-head b { display: block; font: 600 17px/1.3 var(--heading); }
.shop-report-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.shop-report .kui-chip { display: inline-flex; flex: none; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; background: #efedf8; color: #503c90; font-size: 11.5px; font-weight: 600; box-shadow: inset 0 0 0 1px #d9d2f3; }
.shop-run { display: grid; gap: 8px; margin-top: 16px !important; }
.shop-run li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: #f6f5f9; font-size: 14px; }
.shop-run li p { flex: 1; font-weight: 550; }
.shop-run em { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; background: #e6f4ed; color: #2f6b52; font-size: 12px; font-style: normal; font-weight: 650; }
.shop-run .is-fail { background: #fdf2f2; box-shadow: inset 0 0 0 1px #f5c9c8; }
.shop-run .is-fail em { background: #fdecec; color: #a5302f; }
.shop-run-number { display: inline-grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border-radius: 50%; background: #fff; color: var(--accent-dark); font-size: 11px; font-weight: 700; box-shadow: var(--card); }
.shop-stuck { margin-top: 8px; padding: 12px; border-radius: 14px; background: var(--lavender-soft); }
.shop-stuck-head { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.shop-stuck-head b { font-weight: 600; }
.shop-stuck p + p { margin-top: 8px; padding-inline-start: 36px; color: #36333c; font-size: 13.5px; line-height: 1.55; }
.shop-stuck small { display: block; color: var(--accent-dark); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.shop-report-note { margin-top: 14px !important; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* Why the buying step: the benchmark's twenty scenarios. */
.shop-grid-card { padding: 24px; border-radius: 22px; background: #fff; box-shadow: var(--pop); }
.shop-grid-card p { margin: 0; }
.shop-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shop-stats p { padding: 14px 16px; border-radius: 16px; background: #faf6ea; }
.shop-stats strong { display: block; font: 600 32px/1 var(--heading); letter-spacing: -.03em; }
.shop-stats span { display: block; margin-top: 6px; color: #5b5560; font-size: 13px; line-height: 1.45; }
.shop-grid-label { margin-top: 18px !important; color: var(--muted); font-size: 12.5px; }
.shop-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.shop-grid i { aspect-ratio: 1; border-radius: 8px; background: #e7e4ed; }
.shop-grid-card .shop-square--different { background: var(--accent); }
.shop-grid-card .shop-square--tie { background: repeating-linear-gradient(135deg, #e7e4ed 0 4px, #f5f3f8 4px 8px); }
.shop-grid-card .shop-key i { border-radius: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .kui--study { animation: vis-rise 900ms var(--ease-out) both; }
  [data-reveal='shown'] .shop-run li { animation: vis-rise 700ms var(--ease-out) both; }
  [data-reveal='shown'] .shop-run li:nth-child(2) { animation-delay: 150ms; }
  [data-reveal='shown'] .shop-run li:nth-child(3) { animation-delay: 300ms; }
}

@media (max-width: 1020px) {
  .shop-stage, [dir='rtl'] .shop-stage { padding: 0; }
  .shop-float { position: relative; bottom: auto; inset-inline-end: auto; width: min(380px, 88%); margin: -56px 0 0 auto; }
  [dir='rtl'] .shop-float { margin: -56px auto 0 0; }
  .shop-split, .shop-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .shop-float, [dir='rtl'] .shop-float { width: 100%; margin-top: -20px; }
  /* The study is drawn left to right in every language; a phone shows its start: the title, the shoppers and the first model. */
  .shop-window { direction: ltr; }
  .shop-window .kui--study { width: 170%; }
  .shop-art { height: auto; padding: 20px 16px; }
  .shop-tile > :not(.shop-art) { margin-inline: 20px; }
  .shop-ask { grid-template-columns: minmax(0, 1fr); }
  .shop-dots { gap: 3px; }
  .shop-stats strong { font-size: 26px; }
}
