/* XINY visual system, adapted from supplied DESIGN.md. No behavior changes. */
:root {
  --xiny-primary:#04caf6; --xiny-primary-ink:#007f9c; --xiny-secondary:#363636;
  --xiny-tertiary:#bfa5ff; --xiny-action:#ffc65d; --xiny-black:#171717;
  --xiny-radius-sm:6px; --xiny-radius:8px; --xiny-radius-lg:10px;
  --xiny-font:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
  --brand:#04caf6!important; --brand2:#04caf6!important;
  --brand-1:#04caf6!important; --brand-2:#04caf6!important; --brand-3:#bfa5ff!important;
  --accent:#04caf6!important; --cyan:#04caf6!important; --purple:#bfa5ff!important;
  --run-grad:linear-gradient(105deg,#ffc65d,#ffd88f)!important;
}
html[data-theme="light"],html:has(#xh-embedded-light-style) {
  --bg:#fafafa!important; --canvas-bg:#fafafa!important; --panel:#fff!important;
  --card:#fff!important; --card2:#f5f5f5!important; --surface:#fff!important;
  --inset:#f3f3f3!important; --surface-2:#f3f3f3!important; --white:#fff!important;
  --fg:#171717!important; --text:#171717!important; --muted:#686868!important;
  --muted2:#858585!important; --muted-2:#858585!important;
  --line:#e5e5e5!important; --line2:#d4d4d4!important; --line-2:#d4d4d4!important;
  --border:#dedede!important; --line-soft:#f0f0f0!important;
  --purple:#7250b8!important; --cyan:#007f9c!important;
}
html[data-theme="dark"],html:not([data-theme]) {
  --bg:#171717!important; --canvas-bg:#171717!important; --card:#262626!important;
  --card2:#303030!important; --panel:#363636!important; --surface:#363636!important;
  --inset:#292929!important; --surface-2:#292929!important;
  --fg:#f5f5f5!important; --text:#f5f5f5!important; --muted:#ababab!important;
  --muted2:#929292!important; --muted-2:#929292!important;
  --line:#ffffff1a!important; --line2:#ffffff30!important; --line-2:#ffffff30!important;
  --border:#ffffff26!important; --line-soft:#ffffff0d!important;
}
html body,html button,html input,html select,html textarea {font-family:var(--xiny-font)!important}
html button:focus-visible,html a:focus-visible {outline:2px solid var(--xiny-primary);outline-offset:3px}
html input:not([type="checkbox"]):not([type="radio"]):focus-visible,html textarea:focus-visible,html select:focus-visible {outline:2px solid var(--xiny-primary);outline-offset:1px}
html input[type="checkbox"],html input[type="radio"] {accent-color:var(--xiny-primary)}
/* Homepage keeps its light surface and established layout. */
html body:has(.xh-start) {
  --home-brand:#04caf6!important; --home-text:#171717!important;
  --home-muted:#686868!important; --home-line:#e5e5e5!important;
  --home-hover:#f3f3f3!important; --home-panel:#fff!important; --home-bg:#fff!important;
  color:#171717!important;background:#fff!important;
}
html body:has(.xh-start) .pm {background:linear-gradient(100deg,#007f9c,#04caf6)!important}
html body:has(.xh-start) :is(.chip.on,.side-a.on) {color:#171717!important}
html body:has(.xh-start) .chip.on::after {background:#04caf6!important}
html body:has(.xh-start) :is(.side-a,.tool i,.searchbox,.tb-link,.pm-go,.xh-start-plus) {border-radius:8px!important}
html body:has(.xh-start) :is(.direction-card img,.wk-img) {border-radius:10px!important}
html body:has(.xh-start) :is(.side-a,.tool span,.tb-link) {font-size:14px}
html body:has(.xh-start) .sec-head h2 {font-size:20px;line-height:1.4}
/* Shared account, studio, asset and help surfaces. */
html :is(.btn,.btn-primary,.btn-go,.btn-gen,.pack-buy,.pay-btn) {border-radius:8px!important}
html :is(.input,.inp,.ctrl,.search,.searchbox,.drop) {border-radius:8px!important}
html :is(.modal,.dialog,.toast,.viewer-foot,.checkout,.orders,.redeem) {border-radius:10px!important}
html :is(.btn-primary,.btn-go,.btn-gen) {
  background:var(--xiny-action)!important;color:#171717!important;
  border-color:#ffc65d!important;box-shadow:none!important;
}
html :is(.btn-primary,.btn-go,.btn-gen):hover:not(:disabled) {filter:brightness(1.04)}
html :is(.modal,.dialog,.checkout,.orders,.redeem) {background:var(--panel)!important;color:var(--text)!important;border-color:var(--line2)!important}
html[data-theme="light"] :is(.tag.brand,.rate-tip b,.xiny-recharge) {color:#007f9c!important}
html .pack.on {border-color:#04caf6!important;box-shadow:0 0 0 1px #04caf6!important}
html .asset-app :is(.card,.cover,.left nav a.active,.right button.selected) {background:var(--card)!important}
html .asset-app #types button.selected {background:var(--inset)!important;color:var(--text)!important;border-bottom:2px solid #04caf6}
html[data-page="help"] :is(.toc,.article-link[aria-current="page"],button[aria-pressed="true"]) {background:var(--inset)!important;border-color:var(--purple)!important}
html[data-page="help"] :is(#reader p,#reader li) {color:var(--text)!important}
html .item.sel {border-color:#04caf6!important;box-shadow:0 0 0 2px #04caf633!important}
/* Login: keep original forms and brand image. Higher specificity also covers iframe skin. */
html body .auth .panel {background:var(--panel)!important;color:var(--text)!important}
html body .auth .card {border-radius:10px!important}
html body .auth .ctrl {border-radius:8px!important;background:var(--inset)!important;border-color:var(--line)!important}
html body .auth .input {color:var(--text)!important}
html body .auth .field label {color:var(--muted)!important}
html body .auth .link {color:var(--cyan)!important}
html body .auth .btn-primary {background:#ffc65d!important;color:#171717!important;border-radius:8px!important;box-shadow:none!important}
html body .auth .tabs {background:var(--inset)!important}
html body .auth .tab {color:var(--muted)!important}
html body .auth .tab.on {color:var(--text)!important}
html body .auth .glider {background:var(--card)!important}
/* Canvas: visual overrides only; never touch geometry, transforms, ports or pointer events. */
html .xc-app {font-family:var(--xiny-font)!important}
html .xc-node-body {background:var(--card)!important;border-color:var(--line2)!important}
html .xc-node:hover .xc-node-body {border-color:#bfa5ff!important}
html .xc-node.sel .xc-node-body {border-color:#04caf6!important;box-shadow:0 0 0 1px #04caf6,0 12px 32px #0002!important}
html .react-flow__background-pattern.dots {fill:#363636!important}
html[data-theme="light"] .react-flow__background-pattern.dots {fill:#d4d4d4!important}
html :is(.xc-pane-menu,.xc-addmenu,.xc-pop,.xc-image-toolbar,.xc-image-tool-popover,.xc-drawer,.xc-modal) {background:var(--panel)!important;color:var(--fg)!important;border-color:var(--line2)!important;border-radius:10px!important}
html :is(.xc-pane-menu-item,.xc-pop-item):hover:not(:disabled) {background:#04caf61a!important}
html :is(.xc-btn,.xc-chip,.xc-agent-chip) {border-radius:8px!important}
html :is(.xc-btn.pri,.xc-run,.xc-run-btn) {background:var(--run-grad)!important;color:#171717!important}
html :is(.xc-node-title,.xc-agent-title,.xc-drawer-head) {font-weight:600}
html .xc-node-title {font-size:14px}
html .xc-app :is(.xc-chip,.xc-pop-item,.xc-pane-menu-item) {font-size:13px;line-height:1.5}
html :is(.xc-composer,.xc-composer-wrap) {border-color:var(--line2)!important}
html .xc-composer {background:var(--panel)!important;color:var(--fg)!important;border-radius:10px!important}
/* Assistant retains plain-text messages, result sizing and sweep animation. */
html .xc-agent {background:var(--panel)!important;color:var(--fg)!important;border-color:var(--line2)!important;border-radius:10px!important}
html .xc-agent-head {border-bottom-color:var(--line)!important}
html .xc-agent-input {background:var(--card2)!important;border-color:var(--line2)!important;border-radius:10px!important}
html .xc-agent-input textarea {color:var(--fg)!important;font-size:14px;line-height:1.57}
html .xc-agent-msg {font-size:14px;line-height:1.57}
html .xc-agent-send {background:#04caf6!important;color:#171717!important}
html .xc-agent-send:disabled {opacity:.45}
html :is(.xa-plan-card,.xa-card,.xa-skill-menu) {border-color:var(--line2)!important;border-radius:10px!important}
html .xa-generation-preview {border-color:#04caf666!important;border-radius:10px!important}
html .xa-generation-preview:not(.is-failed)::before {background:linear-gradient(110deg,transparent 34%,#04caf610 43%,#04caf64d 50%,#bfa5ff20 57%,transparent 66%)}
html .xa-generation-label {color:var(--fg)!important}
html .xa-plan-response {color:var(--fg)!important}
html :is(.xa-muted,.xc-agent-note) {color:var(--muted)!important}
@media(max-width:767px) {
  html body:has(.xh-start) :is(.side-a,.tool span,.tb-link) {font-size:12px}
  html body:has(.xh-start) .sec-head h2 {font-size:18px}
}
