:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --sidebar-width: 224px;
  --cyan: #29d5e8;
  --cyan-bright: #76efff;
  --ink: #07121d;
  --glass: rgba(26, 43, 54, 0.64);
  --glass-strong: rgba(20, 38, 49, 0.84);
  --line: rgba(255, 255, 255, 0.18);
  --text-soft: rgba(240, 249, 255, 0.72);
  --home-ui-scale: .8;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #08121c; }
body { margin: 0; min-width: 320px; min-height: 100%; color: #fff; overflow-x: hidden; }
button, a { font: inherit; }
button { color: inherit; }

.app-shell { position: relative; min-height: 100vh; isolation: isolate; }

/*
 * Desktop homepage baseline: make browser zoom 100% match the former 80% view.
 * CSS zoom participates in layout, so the entire shell is scaled and reflows as
 * one unit instead of cropping the sides or stretching individual modules.
 */
@media (min-width: 821px) {
  .home-page .app-shell { zoom: var(--home-ui-scale); }
  .home-page .apx-agent-launcher,
  .home-page .apx-agent-panel { zoom: var(--home-ui-scale); }
}

.background-video { position: fixed; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.08) contrast(1.03); }
.background-shade { position: fixed; inset: 0; z-index: -2; background: rgba(4, 12, 20, 0.28); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); min-height: 100vh;
  padding: 28px 18px 22px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(52, 56, 88, 0.76), rgba(30, 42, 61, 0.62));
  border-right: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 14px 0 36px rgba(0, 0, 0, 0.2);
}
.brand { display: flex; align-items: center; gap: 10px; margin: 0 4px 30px; color: #fff; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-name { white-space: nowrap; font-size: 23px; font-weight: 760; letter-spacing: 0; }
.sidebar-nav { display: flex; flex-direction: column; gap: 20px; }
.nav-section { display: grid; gap: 10px; }
.nav-models, .nav-editors, .nav-extensions { gap: 12px; }
.nav-workflows { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.nav-extensions { padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.nav-button, .nav-workflows button, .language-button {
  min-height: 50px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px;
  background: rgba(255, 255, 255, 0.055); cursor: pointer; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.nav-button { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 0 13px; text-align: left; }
.nav-button svg { width: 20px; height: 20px; }
.nav-button span { font-size: 17px; }
.nav-button small { color: var(--cyan-bright); font-size: 12px; }
.nav-workflows button { min-height: 46px; font-size: 16px; }
.nav-button:hover, .nav-workflows button:hover, .language-button:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); transform: translateY(-1px); }
.nav-button.is-active { background: rgba(95, 229, 241, 0.15); border-color: rgba(117, 238, 249, 0.68); box-shadow: inset 3px 0 0 #65e5ef, 0 8px 24px rgba(4, 20, 31, 0.16); }
.nav-button.is-active svg, .nav-button.is-active small { color: #74eff8; }
.nav-workflows button.is-active { background: rgba(95, 229, 241, 0.15); border-color: rgba(117, 238, 249, 0.68); box-shadow: inset 3px 0 0 #65e5ef; }
.language-button { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; }
.language-button svg { width: 18px; }

.model-popover {
  position: fixed; z-index: 45; left: calc(var(--sidebar-width) + 14px); top: 72px; width: min(610px, calc(100vw - var(--sidebar-width) - 32px));
  padding: 14px; border: 1px solid rgba(255,255,255,.44); border-radius: 8px; background: rgba(250,252,255,.97); color: #172030;
  box-shadow: 0 20px 60px rgba(3,9,20,.35); opacity: 0; visibility: hidden; transform: translateX(-8px) scale(.985); transform-origin: top left;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
}
.model-popover.is-open { opacity: 1; visibility: visible; transform: none; }
#imageModels, #videoModels { width: min(700px, calc(100vw - var(--sidebar-width) - 32px)); }
#commerceWorkflows { width: min(1020px, calc(100vw - var(--sidebar-width) - 32px)); }
.popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.popover-head strong { font-size: 16px; }
.popover-head button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px; color: #273044; background: #edf1f5; cursor: pointer; }
.popover-head svg { width: 17px; }
.model-grid { max-height: min(650px, calc(100vh - 140px)); overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 4px 2px 0; scrollbar-width: thin; scrollbar-color: #bdc7d3 transparent; }
.model-grid > button { position: relative; min-width: 0; display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 10px; align-items: center; padding: 9px; text-align: left; border: 1px solid #e2e7ed; border-radius: 8px; background: #fff; color: #182030; cursor: pointer; }
.model-grid > button:hover { border-color: #92ddec; background: #f4fcfe; }
.model-grid > button[data-badge]::before { content: attr(data-badge); position: absolute; z-index: 2; left: 7px; top: -3px; padding: 2px 5px; border-radius: 4px; background: #ff2f72; color: #fff; font-size: 9px; font-weight: 900; font-style: italic; box-shadow: 0 2px 5px rgba(255,47,114,.24); }
.model-grid > button[data-badge="NEW"]::before { background: #27bdd8; box-shadow: 0 2px 5px rgba(39,189,216,.24); }
.model-grid img { width: 48px; height: 48px; padding: 4px; object-fit: contain; border-radius: 7px; background: #f1f3f5; }
.model-grid span { min-width: 0; display: grid; gap: 4px; }
.model-grid strong, .model-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-grid strong { font-size: 14px; }.model-grid small { color: #747d8b; }

.workflow-popover { padding: 16px; }
.workflow-popover-title { display: grid; gap: 2px; }
.workflow-popover-title strong { font-size: 17px; }
.workflow-popover-title small { color: #778190; font-size: 11px; }
.workflow-gallery { max-height: calc(100vh - 145px); overflow-y: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; padding: 2px 4px 2px 0; scrollbar-width: thin; scrollbar-color: #bec8d4 transparent; }
.workflow-tile { min-width: 0; overflow: hidden; display: grid; grid-template-rows: 102px auto auto; gap: 4px; padding: 8px; text-align: left; border: 1px solid #e0e6ec; border-radius: 8px; background: #fff; color: #182030; cursor: pointer; transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.workflow-tile:hover { border-color: #58cfe0; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(21,52,68,.12); }
.workflow-art { position: relative; min-width: 0; overflow: hidden; display: block; border-radius: 6px; background: #e9eef3; }
.workflow-art::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.3); border-radius: inherit; pointer-events: none; }
.workflow-art img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 360ms ease; }
.workflow-tile:hover .workflow-art img { transform: scale(1.045); }
.workflow-tile > strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.workflow-tile > small { overflow: hidden; color: #77808d; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.art-mouse-detail img { object-position: 62% center; transform: scale(1.18); }
.workflow-tile:hover .art-mouse-detail img { transform: scale(1.24); }
.art-product-crop img { object-position: 48% 70%; transform: scale(1.28); }
.workflow-tile:hover .art-product-crop img { transform: scale(1.34); }
.art-three-view img { object-position: center 20%; transform: scale(1.34); }
.workflow-tile:hover .art-three-view img { transform: scale(1.4); }
.workflow-featured { grid-template-rows: 132px; grid-template-columns: 45% minmax(0, 1fr); align-items: stretch; gap: 12px; padding: 9px; color: #fff; border-color: #203a51; background: linear-gradient(135deg, #12273a, #172032); }
.workflow-featured-male { grid-column: span 2; }
.workflow-featured-female { grid-column: span 3; background: linear-gradient(135deg, #101d3a, #172f58); }
.workflow-featured .workflow-art { min-height: 0; }
.workflow-featured .featured-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.workflow-featured em { color: #63e0ec; font-size: 9px; font-style: normal; font-weight: 850; }
.workflow-featured strong { font-size: 17px; line-height: 1.25; }
.workflow-featured small { color: rgba(235,245,252,.68); font-size: 10px; line-height: 1.45; }
.workflow-featured-female .workflow-art img { object-fit: cover; object-position: center; }

.landing-view { margin-left: var(--sidebar-width); min-height: 100vh; padding: clamp(28px, 4vh, 48px) clamp(24px, 3vw, 48px) 34px; }
.hero { width: min(900px, 100%); margin: 0 auto 26px; text-align: center; text-shadow: 0 2px 22px rgba(0,0,0,.46); }
.eyebrow { display: inline-flex; margin: 0 0 8px; padding: 6px 13px; border: 1px solid rgba(119,237,255,.48); border-radius: 999px; background: rgba(3,25,35,.38); color: #d9fbff; font-size: 14px; }
.hero h1 { margin: 0; display: grid; line-height: .98; font-size: clamp(44px, 4.6vw, 68px); font-weight: 850; letter-spacing: 0; }
.hero h1 strong { color: #56e4ed; font-weight: inherit; }
.hero > p:not(.eyebrow) { width: min(780px, 94%); margin: 18px auto 20px; color: rgba(244,249,253,.84); font-size: 16px; line-height: 1.7; }
.primary-cta { min-width: 180px; min-height: 50px; padding: 0 26px; border: 0; border-radius: 999px; background: #fff; color: #151c27; box-shadow: 0 12px 32px rgba(0,0,0,.2); cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease; }
.primary-cta:hover { transform: translateY(-2px); box-shadow: 0 15px 38px rgba(0,0,0,.28); }

.auth-dialog {
  width: min(460px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 28px)); margin: auto; padding: 0;
  overflow: visible; border: 0; border-radius: 20px; background: transparent; color: #172231;
  box-shadow: 0 34px 90px rgba(0, 8, 18, .42);
}
.auth-dialog::backdrop { background: rgba(2, 10, 18, .64); backdrop-filter: blur(10px); }
.auth-shell { position: relative; max-height: min(720px, calc(100vh - 28px)); overflow-y: auto; padding: 30px; border: 1px solid rgba(255,255,255,.82); border-radius: 20px; background: rgba(251,253,255,.98); }
.auth-close { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #eef2f5; color: #344153; cursor: pointer; }
.auth-close:hover { background: #e4ebef; }.auth-close svg { width: 19px; }
.auth-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.auth-logo { width: 54px; height: 54px; flex: 0 0 auto; }.auth-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.auth-head div { min-width: 0; }.auth-head p { margin: 0 0 2px; color: #7a8797; font-size: 12px; }
.auth-head h2 { margin: 0; color: #111c2b; font-size: 24px; line-height: 1.12; }.auth-head div > span { display: block; margin-top: 5px; color: #7a8797; font-size: 12px; }
.auth-tabs { margin: 24px 0 20px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; background: #edf2f5; }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: #74808e; font-weight: 750; cursor: pointer; }
.auth-tabs button.is-active { background: #fff; color: #142131; box-shadow: 0 5px 14px rgba(21,40,54,.1); }
.auth-form { display: none; gap: 15px; }.auth-form.is-active { display: grid; }
.auth-form > label:not(.auth-check), .auth-password-grid label { display: grid; gap: 7px; color: #344153; font-size: 13px; font-weight: 720; }
.auth-form input[type="text"], .auth-form input[type="password"] { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #d9e1e7; border-radius: 11px; outline: 0; background: #fff; color: #182333; font-size: 15px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.auth-form input[type="text"]:focus, .auth-form input[type="password"]:focus { border-color: #25bccd; box-shadow: 0 0 0 3px rgba(37,188,205,.14); }
.auth-password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-form-row > button { border: 0; background: transparent; color: #168da0; font-size: 12px; cursor: pointer; }
.auth-check { display: flex; align-items: center; gap: 8px; color: #667486; font-size: 12px; font-weight: 500; cursor: pointer; }
.auth-check input { width: 17px; height: 17px; margin: 0; accent-color: #17adbf; }
.auth-error { min-height: 18px; margin: -4px 0 -5px; color: #cc4055; font-size: 12px; }
.auth-submit { min-height: 50px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #102334, #0c7e91); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 12px 25px rgba(12,91,107,.2); }
.auth-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.auth-preview-note { margin: 18px 0 0; padding-top: 15px; display: flex; align-items: flex-start; gap: 8px; border-top: 1px solid #e7ecef; color: #7b8793; font-size: 11px; line-height: 1.5; }
.auth-preview-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: #19a3b5; }

.workflow-board { width: min(1260px, 100%); margin: 0 auto; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 18px; border: 1px solid rgba(255,255,255,.34); border-radius: 8px; background: rgba(203,225,232,.22); backdrop-filter: blur(17px) saturate(1.1); box-shadow: 0 24px 60px rgba(0,0,0,.24); }
.workflow-main, .agent-panel { min-width: 0; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: var(--glass-strong); }
.workflow-main { padding: 14px; }
.workflow-head { min-height: 32px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-bottom: 10px; }
.workflow-head span { padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.9); color: #2b3540; font-size: 12px; font-weight: 700; }
.workflow-head strong { text-align: center; font-size: 18px; }
.workflow-head em { color: rgba(237,247,251,.7); font-size: 13px; font-style: normal; font-weight: 700; }

.pipeline-stage { position: relative; height: clamp(300px, 34vw, 370px); min-height: 300px; overflow: hidden; border-radius: 7px; background: rgba(4,19,31,.55); }
.source-card, .generated-card { margin: 0; }
.source-card { position: absolute; z-index: 3; left: 2.3%; top: 18%; width: 19%; height: 64%; opacity: 0; transform: translateX(-22px) scale(.98); transition: opacity 480ms ease, transform 560ms cubic-bezier(.2,.8,.2,1); }
.source-card img, .generated-card img, .video-output video { width: 100%; height: 100%; object-fit: cover; display: block; }
.source-card img { border: 2px solid rgba(255,255,255,.84); border-radius: 8px; }
.source-card figcaption, .generated-card figcaption { position: absolute; left: 8px; bottom: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(4,11,19,.74); color: #fff; font-size: 11px; font-weight: 700; }
.pipeline-stage.source-visible .source-card { opacity: 1; transform: none; }

.pipeline-lines { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flow-line { fill: none; stroke: rgba(222,252,255,.95); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.source-line, .output-line { transition: stroke-dashoffset 760ms cubic-bezier(.35,0,.35,1); }
.line-two, .line-five { transition-delay: 110ms; }.line-three, .line-six { transition-delay: 220ms; }
.pipeline-stage.source-lines-visible .source-line, .pipeline-stage.output-lines-visible .output-line { stroke-dashoffset: 0; }
.junction { fill: #fff; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.2); transition: opacity 200ms ease, transform 360ms cubic-bezier(.18,.9,.25,1.4); }
.pipeline-stage.source-lines-visible .source-junction, .pipeline-stage.output-lines-visible .output-junction { opacity: 1; transform: scale(1); }

.generated-stack { position: absolute; z-index: 4; left: 37%; top: 4.5%; width: 24%; height: 91%; display: grid; grid-template-rows: repeat(3, 1fr); gap: 9px; }
.generated-card { position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.72); border-radius: 8px; opacity: 0; transform: translateX(-18px) scale(.96); filter: saturate(.7); transition: opacity 430ms ease, transform 540ms cubic-bezier(.18,.85,.26,1), filter 500ms ease; }
.generated-card::after { content: "生成中"; position: absolute; right: 7px; top: 7px; padding: 3px 7px; border-radius: 999px; background: rgba(41,213,232,.88); color: #04212a; font-size: 10px; font-weight: 800; }
.pipeline-stage.node-one-visible .generated-one, .pipeline-stage.node-two-visible .generated-two, .pipeline-stage.node-three-visible .generated-three { opacity: 1; transform: none; filter: none; }
.pipeline-stage.output-lines-visible .generated-card::after { content: "已完成"; background: #75efbd; color: #09261b; }

.video-output { position: absolute; z-index: 4; right: 2.2%; top: 8%; width: 24.3%; height: 84%; overflow: hidden; border: 2px solid rgba(255,255,255,.75); border-radius: 8px; background: #07121e; opacity: 0; transform: translateX(24px) scale(.975); transition: opacity 520ms ease, transform 680ms cubic-bezier(.2,.82,.2,1); }
.video-output video { object-position: center; }
.video-status { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 12px 10px; display: grid; gap: 3px; background: linear-gradient(transparent, rgba(3,10,17,.92)); }
.video-status span { font-size: 12px; font-weight: 800; }.video-status small { color: rgba(255,255,255,.75); font-size: 10px; line-height: 1.4; }
.video-scan { position: absolute; z-index: 3; left: 0; right: 0; top: -20%; height: 22%; opacity: 0; background: linear-gradient(transparent, rgba(93,239,255,.44), transparent); }
.pipeline-stage.video-visible .video-output { opacity: 1; transform: none; }
.pipeline-stage.video-visible .video-scan { animation: scan 1.15s ease-out 1; }
@keyframes scan { 0% { top: -20%; opacity: 0; } 20% { opacity: 1; } 100% { top: 110%; opacity: 0; } }

.workflow-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.workflow-progress button { position: relative; height: 38px; overflow: hidden; padding: 0 10px 6px; display: flex; align-items: flex-start; border: 0; color: rgba(255,255,255,.55); background: transparent; cursor: pointer; }
.workflow-progress button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 999px; background: rgba(255,255,255,.16); }
.workflow-progress span { font-size: 12px; }
.workflow-progress i { position: absolute; z-index: 1; left: 0; bottom: 0; width: 0; height: 4px; border-radius: 999px; background: #fff; }
.workflow-progress button.active { color: #fff; }
.workflow-progress button.is-running i { animation: progress 12s linear forwards; }
@keyframes progress { from { width: 0; } to { width: 100%; } }

.agent-panel { padding: 20px 18px; display: flex; flex-direction: column; }
.agent-panel > p { margin: 0 0 8px; color: rgba(226,240,246,.58); font-size: 12px; font-weight: 800; }
.agent-panel h2 { margin: 0 0 13px; font-size: 20px; line-height: 1.35; }
.agent-copy { color: var(--text-soft); font-size: 14px; line-height: 1.65; }
.agent-panel ul { margin: 18px 0 14px; padding: 13px; display: grid; gap: 10px; border-radius: 8px; background: rgba(2,19,27,.3); list-style: none; }
.agent-panel li { display: grid; grid-template-columns: 17px 1fr; gap: 8px; align-items: start; color: rgba(250,253,255,.9); font-size: 13px; line-height: 1.4; }
.agent-panel li svg { width: 17px; height: 17px; color: #74edff; }
.agent-tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 7px; }
.agent-tags span { padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11px; }

.replay-button { position: fixed; z-index: 35; right: 20px; bottom: 20px; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; background: rgba(10,25,45,.8); cursor: pointer; backdrop-filter: blur(10px); }
.replay-button:hover { background: rgba(34,211,232,.72); }.replay-button svg { width: 20px; }
.toast { position: fixed; z-index: 60; left: calc(50% + var(--sidebar-width)/2); bottom: 24px; max-width: min(420px, 80vw); padding: 11px 16px; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; background: rgba(5,17,27,.88); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Three independent creative modules. Only the focused module moves. */
.capability-showcase { width: min(1320px, 100%); margin: 0 auto; }
.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.capability-card {
  --module-accent: #50e5ed;
  position: relative; min-width: 0; min-height: 470px; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,.24); border-radius: 8px;
  background: linear-gradient(165deg, rgba(21,41,53,.76), rgba(11,22,31,.67));
  box-shadow: 0 18px 42px rgba(1,8,14,.22); backdrop-filter: blur(17px) saturate(1.08);
  opacity: .76; transform: translateY(6px); transition: opacity 360ms ease, transform 360ms ease, border-color 360ms ease, box-shadow 360ms ease;
}
.capability-card[data-tone="coral"] { --module-accent: #ff927d; }
.capability-card[data-tone="lime"] { --module-accent: #b8e56c; }
.capability-card::before { content: ""; position: absolute; z-index: 4; left: 0; top: 0; bottom: 0; width: 3px; background: var(--module-accent); opacity: .26; transition: opacity 300ms ease; }
.capability-card.is-active { opacity: 1; transform: none; border-color: color-mix(in srgb, var(--module-accent) 58%, white 12%); box-shadow: 0 24px 58px rgba(1,8,14,.34), 0 0 30px color-mix(in srgb, var(--module-accent) 12%, transparent); }
.capability-card.is-active::before { opacity: 1; }
.module-header { height: 76px; display: grid; grid-template-columns: 44px minmax(0,1fr) 36px; align-items: center; gap: 10px; padding: 0 14px; }
.module-number { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--module-accent) 64%, transparent); border-radius: 8px; color: var(--module-accent); font-size: 13px; font-weight: 850; }
.module-header > div { min-width: 0; display: grid; gap: 3px; }
.module-header small { overflow: hidden; color: color-mix(in srgb, var(--module-accent) 85%, white 15%); font-size: 10px; font-weight: 850; white-space: nowrap; text-overflow: ellipsis; }
.module-header strong { overflow: hidden; font-size: 17px; white-space: nowrap; text-overflow: ellipsis; }
.module-play { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.07); cursor: pointer; transition: background 180ms ease, transform 180ms ease; }
.module-play:hover { transform: scale(1.07); background: color-mix(in srgb, var(--module-accent) 35%, transparent); }
.module-play svg { width: 15px; fill: currentColor; }
.capability-card.is-active .module-play { color: #06141c; border-color: var(--module-accent); background: var(--module-accent); }

.module-media { position: relative; height: 250px; margin: 0 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(2,12,20,.72); }
.module-media > video { width: 100%; height: 100%; display: block; object-fit: cover; opacity: .22; filter: saturate(.7) contrast(1.05); transition: opacity 500ms ease, filter 500ms ease, transform 6s linear; }
.capability-card.is-active .module-media > video { opacity: .92; filter: saturate(1.04) contrast(1.02); transform: scale(1.025); }
.capability-card[data-layout="video-reference"] { min-height: 720px; }
.full-frame-media {
  height: auto; display: grid; grid-template-rows: auto 152px; overflow: hidden;
  background: rgba(3,10,17,.88);
}
.full-frame-media > video {
  position: relative; z-index: 1; width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: contain; object-position: center; background: #060b12; opacity: .62;
}
.capability-card.is-active .full-frame-media > video { opacity: 1; transform: none; filter: saturate(1.02) contrast(1.01); }
.capability-card[data-layout="video-reference"] .canvas-links,
.capability-card[data-layout="video-reference"] .canvas-node,
.capability-card[data-layout="video-reference"] .product-reticle,
.capability-card[data-layout="video-reference"] .product-callout,
.capability-card[data-layout="video-reference"] .media-label { display: none; }
.character-views {
  position: relative; z-index: 6; padding: 10px 11px 11px;
  border-top: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(14,25,34,.93), rgba(8,16,24,.97));
}
.character-views-head { height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.character-views-head span { color: var(--module-accent); font-size: 9px; font-weight: 850; }
.character-views-head em { color: rgba(238,247,251,.52); font-size: 9px; font-style: normal; }
.character-views-grid { height: 105px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.character-views figure { position: relative; min-width: 0; height: 105px; margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; background: #f4f4f3; }
.character-views figure > span { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(245,250,253,.3); }
.character-views figure svg { width: 20px; height: 20px; }
.character-views figure svg.reference-crop { width: 100%; height: 100%; display: block; }
.reference-crop image { image-rendering: auto; }
.character-views figcaption { position: absolute; z-index: 2; left: 5px; bottom: 5px; padding: 3px 5px; border-radius: 4px; background: rgba(5,12,19,.72); color: rgba(255,255,255,.92); font-size: 8px; backdrop-filter: blur(5px); }
.capability-card.is-active .character-views figure { border-color: color-mix(in srgb, var(--module-accent) 42%, transparent); background: color-mix(in srgb, var(--module-accent) 7%, rgba(255,255,255,.04)); }
.media-label { position: absolute; z-index: 5; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: rgba(4,12,20,.7); color: rgba(255,255,255,.88); backdrop-filter: blur(8px); }
.media-label svg { width: 14px; height: 14px; color: var(--module-accent); }.media-label span { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }

.portrait-media > video { object-position: 58% center; }
.portrait-source { position: absolute; z-index: 3; left: 10px; top: 12px; width: 30%; height: 54%; overflow: hidden; border: 1px solid rgba(255,255,255,.72); border-radius: 7px; box-shadow: 0 12px 24px rgba(0,0,0,.28); transform: translateX(-10px); opacity: .5; transition: 440ms ease; }
.portrait-source img { width: 100%; height: 100%; display: block; object-fit: cover; }.portrait-source span { position: absolute; left: 5px; top: 5px; padding: 3px 5px; border-radius: 4px; background: rgba(4,12,20,.74); font-size: 8px; font-weight: 800; }
.portrait-rail { position: absolute; z-index: 3; right: 8px; top: 12px; width: 25%; height: 62%; display: grid; gap: 5px; opacity: .34; transform: translateX(10px); transition: 520ms ease 120ms; }
.portrait-rail img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; border: 1px solid rgba(255,255,255,.58); border-radius: 5px; }
.capability-card.is-active .portrait-source, .capability-card.is-active .portrait-rail { opacity: 1; transform: none; }

.canvas-media > video { object-position: center; }
.canvas-media::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 26px 26px; opacity: .55; }
.canvas-links { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; }
.canvas-links path { fill: none; stroke: var(--module-accent); stroke-width: 1.6; stroke-dasharray: 7 5; opacity: .35; }
.canvas-node { position: absolute; z-index: 3; width: 84px; min-height: 46px; display: flex; align-items: center; gap: 6px; padding: 7px; border: 1px solid rgba(255,255,255,.32); border-radius: 6px; background: rgba(15,24,32,.72); color: #fff; opacity: .52; transform: scale(.92); transition: opacity 360ms ease, transform 360ms ease, border-color 360ms ease; }
.canvas-node svg { width: 15px; color: var(--module-accent); }.canvas-node span { font-size: 11px; white-space: nowrap; }
.node-a { left: 7%; top: 21%; }.node-b { left: 42%; top: 12%; }.node-c { left: 43%; top: 61%; }.node-d { right: 5%; top: 38%; }
.capability-card.is-active .canvas-node { opacity: 1; transform: none; border-color: color-mix(in srgb, var(--module-accent) 52%, transparent); }
.capability-card.is-active .node-b { transition-delay: 180ms; }.capability-card.is-active .node-c { transition-delay: 330ms; }.capability-card.is-active .node-d { transition-delay: 520ms; }
.capability-card.is-active .canvas-links path { opacity: .8; animation: canvas-dash 1.8s linear infinite; }
@keyframes canvas-dash { to { stroke-dashoffset: -24; } }

.product-media > video { object-position: center; }
.product-reticle { position: absolute; z-index: 2; inset: 16% 23%; opacity: .38; transition: opacity 360ms ease; }
.product-reticle span { position: absolute; width: 28px; height: 28px; border-color: var(--module-accent); border-style: solid; }
.product-reticle span:nth-child(1) { left: 0; top: 0; border-width: 2px 0 0 2px; }.product-reticle span:nth-child(2) { right: 0; top: 0; border-width: 2px 2px 0 0; }.product-reticle span:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 2px 2px; }.product-reticle span:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.product-callout { position: absolute; z-index: 3; display: flex; align-items: center; gap: 5px; color: rgba(255,255,255,.75); font-size: 10px; opacity: .38; transform: translateX(8px); transition: opacity 360ms ease, transform 420ms ease; }
.product-callout i { width: 42px; height: 1px; background: var(--module-accent); }.product-callout span { padding: 4px 6px; border-radius: 4px; background: rgba(3,12,18,.68); }
.callout-a { right: 7%; top: 20%; }.callout-b { left: 7%; top: 45%; flex-direction: row-reverse; }.callout-c { right: 8%; top: 67%; }
.capability-card.is-active .product-reticle { opacity: 1; animation: reticle-pulse 2s ease-in-out infinite; }
.capability-card.is-active .product-callout { opacity: 1; transform: none; }.capability-card.is-active .callout-b { transition-delay: 220ms; }.capability-card.is-active .callout-c { transition-delay: 420ms; }
@keyframes reticle-pulse { 50% { transform: scale(.96); opacity: .72; } }

.module-copy { padding: 16px 15px 19px; display: flex; flex: 1; flex-direction: column; }
.module-copy p { margin: 0 0 15px; color: rgba(240,248,252,.72); font-size: 13px; line-height: 1.65; }
.module-tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.module-tags span { padding: 5px 7px; border-radius: 999px; background: rgba(255,255,255,.09); color: rgba(255,255,255,.78); font-size: 10px; }
.module-copy.delivery-panel { padding: 12px 14px 15px; gap: 8px; }
.module-copy.delivery-panel .delivery-summary { margin: 0; min-height: 34px; color: rgba(244,250,252,.8); font-size: 12px; line-height: 1.5; opacity: 0; transform: translateY(7px); }
.delivery-list { position: relative; margin: 0; padding: 7px 8px 7px 10px; display: grid; gap: 5px; border-radius: 7px; background: rgba(3,17,25,.3); list-style: none; opacity: 0; transform: translateY(5px); }
.delivery-list::before { content: ""; position: absolute; left: 17px; top: 19px; bottom: 19px; width: 1px; background: color-mix(in srgb, var(--module-accent) 38%, transparent); }
.delivery-list li { position: relative; z-index: 1; min-width: 0; display: grid; grid-template-columns: 17px minmax(0,1fr); align-items: center; gap: 6px; color: rgba(246,251,253,.88); font-size: 11px; line-height: 1.35; opacity: 0; transform: translateY(8px); }
.delivery-list li svg { width: 15px; height: 15px; color: var(--module-accent); fill: rgba(4,17,24,.95); }
.delivery-list li span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.delivery-meta { display: flex; flex-wrap: wrap; gap: 5px; opacity: 0; transform: translateY(6px); }
.delivery-meta span { padding: 4px 7px; border-radius: 999px; background: rgba(255,255,255,.1); color: rgba(245,250,252,.72); font-size: 9px; }
.delivery-next { min-height: 39px; margin-top: auto; padding: 7px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); color: rgba(244,249,251,.72); opacity: 0; transform: translateY(6px); }
.delivery-next > span { min-width: 0; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.delivery-next strong { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,.9); font-size: 10px; }
.delivery-next strong svg { width: 13px; height: 13px; color: var(--module-accent); }
.capability-card.is-active .delivery-summary { animation: delivery-line-in .38s ease-out .08s both; }
.capability-card.is-active .delivery-list { animation: delivery-line-in .22s ease-out .32s both; }
.capability-card.is-active .delivery-list li:nth-child(1) { animation: delivery-line-in .36s ease-out .45s both; }
.capability-card.is-active .delivery-list li:nth-child(2) { animation: delivery-line-in .36s ease-out .85s both; }
.capability-card.is-active .delivery-list li:nth-child(3) { animation: delivery-line-in .36s ease-out 1.25s both; }
.capability-card.is-active .delivery-list li:nth-child(4) { animation: delivery-line-in .36s ease-out 1.65s both; }
.capability-card.is-active .delivery-meta { animation: delivery-line-in .36s ease-out 2.08s both; }
.capability-card.is-active .delivery-next { animation: delivery-line-in .36s ease-out 2.42s both; }
@keyframes delivery-line-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .delivery-summary, .delivery-list li, .delivery-meta, .delivery-next { opacity: 1 !important; transform: none !important; animation: none !important; }
}
.module-progress { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.08); }
.module-progress i { display: block; width: 0; height: 100%; background: var(--module-accent); }
.capability-card.is-active .module-progress i { animation: module-progress 8s linear forwards; }
@keyframes module-progress { from { width: 0; } to { width: 100%; } }
.showcase-nav { height: 30px; display: flex; align-items: end; justify-content: center; gap: 8px; }
.showcase-nav button { width: 28px; height: 5px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.3); cursor: pointer; transition: width 220ms ease, background 220ms ease; }
.showcase-nav button.is-active { width: 52px; background: #fff; }

/* 1120px / 820px breakpoints converted for the 80% desktop baseline. */
@media (max-width: 896px) {
  :root { --sidebar-width: 190px; }
  .sidebar { padding-inline: 14px; }
  .brand-name { font-size: 20px; }
  .workflow-board { grid-template-columns: 1fr; }
  .agent-panel { min-height: 190px; }
  .agent-tags { margin-top: 16px; }
  .capability-grid { grid-template-columns: 1fr 1fr; }
  .capability-card:last-child { grid-column: 1 / -1; }
}
@media (max-height: 656px) and (min-width: 821px) {
  .sidebar { padding: 12px 12px 10px; }
  .brand { gap: 8px; margin: 0 4px 10px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 19px; }
  .sidebar-nav { gap: 7px; }
  .nav-section, .nav-models, .nav-editors, .nav-extensions { gap: 5px; }
  .nav-workflows { padding: 4px 0; }
  .nav-extensions { padding-top: 6px; }
  .nav-button, .nav-workflows button, .language-button { min-height: 38px; border-radius: 7px; }
  .nav-button { grid-template-columns: 18px 1fr auto; gap: 8px; padding: 0 10px; }
  .nav-button svg { width: 17px; height: 17px; }
  .nav-button span { font-size: 13px; }
  .nav-button small { font-size: 10px; }
  .nav-workflows button { min-height: 34px; font-size: 12px; }
  .language-button { min-height: 36px; font-size: 12px; }

  .landing-view { padding: 10px 22px 8px; }
  .hero { margin-bottom: 10px; }
  .eyebrow { margin-bottom: 3px; padding: 3px 9px; font-size: 10px; }
  .hero h1 { font-size: clamp(34px, 3.5vw, 46px); line-height: .94; }
  .hero > p:not(.eyebrow) { margin: 7px auto 9px; font-size: 12px; line-height: 1.45; }
  .primary-cta { min-width: 150px; min-height: 38px; padding-inline: 20px; font-size: 13px; }
  .capability-grid { gap: 10px; }
  .capability-card[data-layout="video-reference"] { min-height: 0; height: 468px; }
  .module-header { height: 52px; grid-template-columns: 36px minmax(0,1fr) 30px; gap: 7px; padding: 0 10px; }
  .module-number { width: 34px; height: 34px; font-size: 11px; }
  .module-header strong { font-size: 14px; }.module-header small { font-size: 8px; }
  .module-play { width: 29px; height: 29px; }.module-play svg { width: 13px; }
  .module-media { margin-inline: 9px; }
  .full-frame-media { grid-template-rows: 142px 92px; }
  .full-frame-media > video { height: 142px; aspect-ratio: auto; object-fit: cover; }
  .character-views { padding: 5px 7px 7px; }
  .character-views-head { height: 17px; }
  .character-views-head span, .character-views-head em { font-size: 7px; }
  .character-views-grid, .character-views figure { height: 63px; }
  .character-views-grid { gap: 4px; }
  .character-views figcaption { left: 3px; bottom: 3px; padding: 2px 3px; font-size: 6px; }
  .module-copy.delivery-panel { min-height: 0; padding: 7px 10px 9px; gap: 4px; overflow: hidden; }
  .module-copy.delivery-panel .delivery-summary { min-height: 0; font-size: 10px; line-height: 1.35; }
  .delivery-list { padding: 5px 6px; gap: 3px; }
  .delivery-list::before { display: none; }
  .delivery-list li { grid-template-columns: 13px minmax(0,1fr); gap: 4px; font-size: 9px; line-height: 1.2; }
  .delivery-list li svg { width: 12px; height: 12px; }
  .delivery-meta { gap: 3px; }.delivery-meta span { padding: 2px 5px; font-size: 7px; }
  .delivery-next { min-height: 26px; padding: 4px 5px; }.delivery-next > span, .delivery-next strong { font-size: 8px; }
  .delivery-next strong svg { width: 10px; height: 10px; }
  .showcase-nav { height: 16px; }
  .showcase-nav button { width: 22px; height: 4px; }.showcase-nav button.is-active { width: 38px; }

  .model-popover { top: 10px; max-height: calc(100vh - 20px); overflow: hidden; }
  .model-grid, .workflow-gallery { max-height: calc(100vh - 76px); }
  .workflow-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .workflow-featured-male, .workflow-featured-female { grid-column: span 2; }
}
@media (max-width: 820px) {
  :root { --sidebar-width: 76px; }
  .sidebar { align-items: center; padding: 20px 9px; }
  .brand { margin-inline: 0; }.brand-name, .nav-button span, .nav-button small, .language-button span { display: none; }
  .nav-button { width: 56px; grid-template-columns: 1fr; place-items: center; padding: 0; }
  .nav-workflows { display: none; }.language-button { width: 56px; justify-content: center; }
  .model-popover { width: min(560px, calc(100vw - 96px)); }
  .landing-view { padding-inline: 16px; }
  .hero h1 { font-size: 46px; }
  .capability-grid { grid-template-columns: 1fr; }
  .capability-card:last-child { grid-column: auto; }
  .capability-card { min-height: 450px; }
  #commerceWorkflows { width: min(640px, calc(100vw - 96px)); }
  .workflow-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-featured-male, .workflow-featured-female { grid-column: span 2; }
}
@media (max-width: 640px) {
  .auth-shell { padding: 24px 18px 20px; }.auth-password-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }.hero > p:not(.eyebrow) { font-size: 14px; }
  .workflow-board { padding: 10px; }.workflow-main { padding: 10px; }
  .workflow-head { grid-template-columns: auto 1fr; }.workflow-head em { display: none; }.workflow-head strong { text-align: right; font-size: 14px; }
  .pipeline-stage { height: 560px; }
  .pipeline-lines { display: none; }
  .source-card { left: 5%; top: 4%; width: 38%; height: 27%; }
  .generated-stack { left: 49%; top: 3%; width: 46%; height: 29%; grid-template-columns: repeat(3,1fr); grid-template-rows: 1fr; gap: 5px; }
  .generated-card figcaption { left: 4px; bottom: 4px; padding: 3px 5px; font-size: 9px; }
  .video-output { left: 5%; right: auto; top: 36%; width: 90%; height: 59%; }
  .model-grid { grid-template-columns: 1fr; }
  .capability-card { min-height: 430px; }
  .module-media { height: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
