/* Scoped, progressively enhanced commerce architecture. Theme colors come from Expo. */
body.expo-theme .commerce-map { padding: 112px 0; color: var(--ex-text); background: var(--ex-bg); }
.commerce-map [hidden] { display: none !important; }
.commerce-map .cm-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 48px; }
.commerce-map .cm-eyebrow { color: var(--ex-text-2); font-size: 11px; font-weight: 600; letter-spacing: .16em; margin: 0 0 20px; }
body.expo-theme .commerce-map h2 { font-size: clamp(32px, 3.8vw, 52px); line-height: 1.18; letter-spacing: -.04em; margin: 0; color: var(--ex-text); }
.commerce-map .cm-intro { max-width: 430px; color: var(--ex-text-2); font-size: 15px; line-height: 1.9; }
.commerce-map .cm-intro p { margin: 0 0 20px; }
.commerce-map .cm-intro > span { font-size: 12px; }
.commerce-map .cm-intro > span > span { margin: 0 12px; }
.commerce-map .cm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--ex-border); padding: 16px 0; }
.commerce-map .cm-toolbar > div { display: flex; gap: 8px; }
.commerce-map .cm-breadcrumb { margin: 0; color: var(--ex-text-2); font-size: 13px; }
.commerce-map .cm-breadcrumb span { margin: 0 12px; }
.commerce-map button { font: inherit; cursor: pointer; color: var(--ex-text); border: 1px solid var(--ex-border-strong); background: var(--ex-surface); border-radius: 9999px; min-height: 44px; }
.commerce-map button:focus-visible, .commerce-map summary:focus-visible, .commerce-map #cm-selected-title:focus-visible { outline: 2px solid var(--ex-link); outline-offset: 5px; }
.commerce-map .cm-toolbar button { padding: 8px 16px; font-size: 12px; }
.commerce-map button:hover { border-color: var(--ex-link); color: var(--ex-link); }
.commerce-map .cm-stage { position: relative; height: 800px; border: 1px solid var(--ex-border); background: var(--ex-surface); isolation: isolate; }
.commerce-map .cm-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.commerce-map .cm-wires path { stroke: var(--ex-border-strong); stroke-width: 1; fill: none; stroke-dasharray: 3 5; animation: cm-flow 1.4s linear infinite; }
.commerce-map .cm-wires .cm-pulse { fill: var(--ex-link); }
.commerce-map .cm-wires circle { fill: var(--ex-text-2); }
.commerce-map .cm-core { position: absolute; width: 230px; left: 50%; top: 48%; transform: translate(-50%, -50%); text-align: center; }
.commerce-map .cm-stack { width: 150px; height: 150px; margin: 0 auto 24px; position: relative; }
.commerce-map .cm-stack i { position: absolute; inset: 22px; border: 1px solid var(--ex-border-strong); animation: cm-ring 3.6s ease-out infinite; }
.commerce-map .cm-stack i:nth-child(2) { animation-delay: 1.2s; }
.commerce-map .cm-stack i:nth-child(3) { animation-delay: 2.4s; }
.commerce-map .cm-stack i:nth-child(4) { inset: 30px; background: var(--ex-bg); animation: cm-breathe 3.6s ease-in-out infinite; }
.commerce-map .cm-stack > span { position: absolute; inset: 30px; display: grid; place-content: center; text-align: center; font-size: 9px; letter-spacing: .12em; line-height: 1.8; color: var(--ex-text-2); }
.commerce-map .cm-stack b { font-size: 12px; color: var(--ex-text); }
body.expo-theme .commerce-map .cm-core h3 { margin: 0; font-size: 25px; color: var(--ex-text); }
.commerce-map .cm-core > p { font-size: 12px; margin: 8px 0 22px; color: var(--ex-text-2); }
.commerce-map .cm-infrastructure { padding: 0; margin: 0; list-style: none; text-align: left; }
.commerce-map .cm-infrastructure li { padding: 10px 14px; border-bottom: 1px solid var(--ex-border); background: var(--ex-bg); }
.commerce-map .cm-infrastructure b { display: block; font-size: 12px; font-weight: 600; }
.commerce-map .cm-infrastructure span { font-size: 11px; color: var(--ex-text-2); }
.commerce-map .cm-groups { position: absolute; inset: 26px 32px 160px; display: grid; grid-template-columns: minmax(0,1fr) 280px minmax(0,1fr); grid-template-rows: repeat(3,1fr); column-gap: 36px; row-gap: 22px; }
.commerce-map .cm-group { min-width: 0; align-self: center; }
.commerce-map .cm-group:nth-child(1) { grid-area: 1 / 1; }
.commerce-map .cm-group:nth-child(2) { grid-area: 2 / 1; }
.commerce-map .cm-group:nth-child(3) { grid-area: 3 / 1; }
.commerce-map .cm-group:nth-child(4) { grid-area: 1 / 3; }
.commerce-map .cm-group:nth-child(5) { grid-area: 2 / 3; }
.commerce-map .cm-group:nth-child(6) { grid-area: 3 / 3; }
.commerce-map .cm-group h3 { font-size: 11px; font-weight: 500; color: var(--ex-text-2); margin: 0 0 10px 12px; letter-spacing: .08em; }
.commerce-map .cm-group-inner { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.commerce-map .cm-node { padding: 11px 10px; font-size: 12px; line-height: 1.4; text-align: left; transition: transform .2s ease, border-color .2s ease; }
.commerce-map .cm-stage.is-pending .cm-node { opacity: 0; }
.commerce-map .cm-stage.is-live .cm-node { animation: cm-pop .5s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i, 0) * 35ms); }
.commerce-map .cm-stage.is-live .cm-group:nth-child(n+4) .cm-node { animation-name: cm-pop-r; }
.commerce-map .cm-node:hover { transform: translateY(-3px); }
.commerce-map .cm-number { color: var(--ex-text-2); font-size: 10px; margin-right: 7px; font-variant-numeric: tabular-nums; }
.commerce-map .cm-stage.is-expanded .cm-core { left: 17%; }
.commerce-map .cm-branch { position: absolute; inset: 30px 26px 160px 36%; display: grid; grid-template-columns: .85fr 1.25fr; align-items: center; gap: 54px; }
.commerce-map .cm-selected { background: var(--ex-bg); padding: 24px 18px; border: 1px solid var(--ex-border-strong); }
.commerce-map .cm-selected .cm-eyebrow { font-size: 10px; letter-spacing: .03em; margin-bottom: 12px; }
body.expo-theme .commerce-map .cm-selected h3 { font-size: 24px; line-height: 1.35; margin: 0; color: var(--ex-text); }
.commerce-map .cm-selected p:last-child { font-size: 12px; margin: 12px 0 0; color: var(--ex-text-2); }
.commerce-map .cm-leaves { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.commerce-map .cm-leaves li { font-size: 13px; line-height: 1.5; padding: 13px 16px; background: var(--ex-bg); border: 1px solid var(--ex-border); animation: cm-appear .32s ease both; }
.commerce-map li[data-extension] { border-style: dashed; }
.commerce-map li[data-extension] span { display: inline-block; font-size: 10px; border: 1px solid var(--ex-border-strong); border-radius: 9999px; padding: 2px 6px; margin-left: 4px; color: var(--ex-text-2); }
.commerce-map .cm-scope { font-size: 12px; line-height: 1.8; color: var(--ex-text-2); margin: 20px 0 0; }
.commerce-map .cm-catalog { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; align-items: start; }
.commerce-map .cm-module { border: 1px solid var(--ex-border); background: var(--ex-surface); }
.commerce-map .cm-module summary { padding: 16px; min-height: 52px; cursor: pointer; font-size: 14px; }
.commerce-map .cm-module[open] summary { font-weight: 600; background: var(--ex-bg); }
.commerce-map .cm-module ul { padding: 0 24px 0 34px; font-size: 13px; line-height: 1.8; }
.commerce-map .cm-module-note { margin: 16px; font-size: 12px; line-height: 1.7; color: var(--ex-text-2); }
/* 海水寶寶 guide: Clawd-style pixel buddy in aqua, 2D CSS motion. */
.commerce-map .cm-guide { position: absolute; left: 32px; right: 32px; bottom: 22px; display: flex; align-items: flex-end; gap: 18px; z-index: 1; --cm-aqua: #5cc8e2; --cm-aqua-eye: #0c1e1c; }
.commerce-map .cm-buddy { position: relative; flex: 0 0 96px; height: 64px; margin-bottom: 12px; animation: cm-bob 3.2s ease-in-out infinite; }
.commerce-map .cm-buddy svg { width: 100%; height: 100%; overflow: visible; fill: var(--cm-aqua); }
.commerce-map .cm-buddy-eyes { fill: var(--cm-aqua-eye); transform-origin: 60px 21px; animation: cm-blink 4.8s infinite; }
.commerce-map .cm-buddy-arm-r { animation: cm-wave 1.4s steps(2, jump-none) infinite; }
.commerce-map .cm-buddy-legs rect:nth-child(odd) { animation: cm-step .8s steps(2, jump-none) infinite; }
.commerce-map .cm-buddy-legs rect:nth-child(even) { animation: cm-step .8s steps(2, jump-none) infinite reverse; }
.commerce-map .cm-buddy > i { position: absolute; left: 50%; top: -8px; width: 6px; height: 6px; border: 1px solid var(--ex-text-2); border-radius: 50%; opacity: 0; animation: cm-rise 3.6s ease-in infinite; }
.commerce-map .cm-buddy > i:nth-of-type(2) { left: 64%; width: 4px; height: 4px; animation-delay: 1.2s; }
.commerce-map .cm-buddy > i:nth-of-type(3) { left: 40%; animation-delay: 2.4s; }
.commerce-map .cm-guide.is-talking .cm-buddy svg { animation: cm-hop .6s cubic-bezier(.34,1.56,.64,1); }
.commerce-map .cm-guide-bubble { position: relative; max-width: 560px; margin-bottom: 40px; padding: 14px 18px; background: var(--ex-bg); border: 1px solid var(--ex-border-strong); }
.commerce-map .cm-guide-bubble::before { content: ''; position: absolute; left: -7px; bottom: 18px; width: 12px; height: 12px; background: var(--ex-bg); border-left: 1px solid var(--ex-border-strong); border-bottom: 1px solid var(--ex-border-strong); transform: rotate(45deg); }
.commerce-map .cm-guide-name { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--ex-text-2); margin-bottom: 6px; }
.commerce-map .cm-guide-text { margin: 0; font-size: 13px; line-height: 1.75; color: var(--ex-text); }
.commerce-map .cm-guide.is-talking .cm-guide-text { animation: cm-say .4s ease both; }
@keyframes cm-flow { to { stroke-dashoffset: -16; } }
@keyframes cm-ring { 0% { transform: scale(.85); opacity: 0; } 20% { opacity: 1; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes cm-breathe { 50% { transform: scale(1.04); } }
@keyframes cm-pop { from { opacity: 0; transform: translateX(28px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes cm-pop-r { from { opacity: 0; transform: translateX(-28px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes cm-bob { 50% { transform: translateY(-7px); } }
@keyframes cm-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes cm-wave { to { transform: translateY(-10px); } }
@keyframes cm-step { to { transform: translateY(-4px); } }
@keyframes cm-rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .8; } 100% { transform: translateY(-46px); opacity: 0; } }
@keyframes cm-hop { 40% { transform: translateY(-12px); } }
@keyframes cm-say { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes cm-appear { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@media (max-width: 1100px) and (min-width: 761px) {
 .commerce-map .cm-groups { inset-inline: 20px; grid-template-columns: minmax(0,1fr) 210px minmax(0,1fr); column-gap: 22px; }
 .commerce-map .cm-core { width: 200px; }
 .commerce-map .cm-node { font-size: 11px; padding: 10px 8px; }
 .commerce-map .cm-number { display: none; }
 .commerce-map .cm-branch { gap: 30px; }
}
@media (max-width: 760px) {
 body.expo-theme .commerce-map { padding: 80px 0; }
 .commerce-map .cm-heading { display: block; margin-bottom: 30px; }
 .commerce-map .cm-intro { margin-top: 24px; font-size: 14px; }
 .commerce-map .cm-intro p { margin-bottom: 14px; }
 .commerce-map .cm-toolbar { flex-wrap: wrap; gap: 8px; position: sticky; top: 76px; z-index: 4; background: var(--ex-bg); }
 .commerce-map .cm-breadcrumb { font-size: 12px; }
 .commerce-map .cm-stage { height: auto; padding: 28px 18px 40px; }
 .commerce-map .cm-core, .commerce-map .cm-stage.is-expanded .cm-core { position: relative; left: auto; top: auto; transform: none; width: 100%; display: grid; grid-template-columns: 110px 1fr; column-gap: 18px; text-align: left; align-items: center; }
 .commerce-map .cm-stack { grid-column: 1; grid-row: 1 / 4; width: 110px; height: 110px; margin: 0; }
 .commerce-map .cm-stack i { inset: 14px; }
 .commerce-map .cm-stack i:nth-child(4), .commerce-map .cm-stack > span { inset: 20px; }
 .commerce-map .cm-stack > span { font-size: 7px; }
 .commerce-map .cm-stack b { font-size: 10px; }
 body.expo-theme .commerce-map .cm-core h3 { font-size: 21px; grid-column: 2; }
 .commerce-map .cm-core > p { grid-column: 2; margin: 5px 0 12px; }
 .commerce-map .cm-infrastructure { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 14px; gap: 6px; }
 .commerce-map .cm-infrastructure li { padding: 10px 8px; }
 .commerce-map .cm-infrastructure b { font-size: 11px; }
 .commerce-map .cm-infrastructure span { font-size: 10px; display: block; line-height: 1.7; }
 .commerce-map .cm-groups { position: relative; inset: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: auto; gap: 26px 16px; margin-top: 28px; }
 .commerce-map .cm-group:nth-child(n) { grid-area: auto; align-self: start; }
 .commerce-map .cm-group-inner { grid-template-columns: 1fr; }
 .commerce-map .cm-stage.is-live .cm-node, .commerce-map .cm-stage.is-live .cm-group:nth-child(n+4) .cm-node { animation-name: cm-say; }
 .commerce-map .cm-group h3 { margin-left: 4px; }
 .commerce-map .cm-node { font-size: 12px; }
 .commerce-map .cm-branch { position: relative; inset: auto; display: block; margin-top: 28px; }
 .commerce-map .cm-selected { padding: 18px; }
 .commerce-map .cm-leaves { margin: 26px 0 0 28px; gap: 10px; }
 .commerce-map .cm-leaves li { font-size: 13px; }
 .commerce-map .cm-guide { position: relative; left: auto; right: auto; bottom: auto; margin-top: 28px; gap: 10px; }
 .commerce-map .cm-buddy { flex-basis: 66px; height: 44px; margin-bottom: 8px; }
 .commerce-map .cm-guide-bubble { margin-bottom: 26px; padding: 12px 14px; }
 .commerce-map .cm-guide-text { font-size: 12px; }
 .commerce-map .cm-catalog { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
 .commerce-map *, .commerce-map *::before, .commerce-map *::after { animation: none !important; transition: none !important; }
 .commerce-map .cm-node:hover { transform: none; }
 .commerce-map .cm-stage.is-pending .cm-node { opacity: 1; }
}
