/* nx-kit Tier B · embed + templates */
.nx-er { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.nx-er-row { display: contents; }
.nx-er-chip, .nx-er-add { display: inline-flex; align-items: center; gap: .3rem; height: 2rem; padding: 0 .55rem; border-radius: 999px; background: color-mix(in srgb, var(--text) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); font-weight: 700; font-size: .85rem; transition: background-color .2s, box-shadow .2s, transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.nx-er-chip:active { transform: scale(.9); }
.nx-er-chip.is-mine { background: color-mix(in srgb, #5865f2 25%, transparent); box-shadow: inset 0 0 0 1px #5865f2; }
.nx-er-chip.is-pop span { animation: nx-er-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes nx-er-pop { 30% { transform: scale(1.6) rotate(-12deg); } }
.nx-er-chip .nx-digits { font-size: .82rem; height: 1rem; min-width: 1ch; padding: 0; }
.nx-er-chip .nx-digit, .nx-er-chip .nx-digit i { height: 1rem; line-height: 1rem; }
.nx-er-add { color: var(--muted); font-size: .8rem; }
.nx-er-pick { position: absolute; z-index: 10; left: 0; bottom: calc(100% + .4rem); display: grid; grid-template-columns: repeat(4, 2.2rem); gap: .15rem; padding: .3rem; border-radius: 14px; background: var(--panel-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent); transform: scale(.6) translateY(8px); transform-origin: 1rem 100%; opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.3, 1.3, .5, 1), opacity .15s; }
.nx-er.is-open .nx-er-pick { transform: none; opacity: 1; pointer-events: auto; }
.nx-er-pick button { height: 2.2rem; border-radius: 8px; font-size: 1.2rem; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), background-color .15s; }
.nx-er-pick button:hover { transform: scale(1.25); background: color-mix(in srgb, var(--text) 8%, transparent); }

.nx-pal { display: grid; gap: .7rem; width: min(22rem, 100%); }
.nx-pal-row { display: flex; height: 7rem; border-radius: var(--radius-lg); overflow: hidden; }
.nx-pal-row button { --c: #888; flex: 1; position: relative; background: var(--c); transition: flex .35s cubic-bezier(.3, 1.2, .5, 1), background-color .45s calc(var(--i) * 50ms); }
.nx-pal-row button:hover { flex: 1.8; }
.nx-pal-row span { position: absolute; left: 50%; bottom: .5rem; translate: -50% 0; font: 800 .66rem/1 ui-monospace, monospace; color: #fff; mix-blend-mode: difference; opacity: 0; transition: opacity .2s; text-transform: uppercase; }
.nx-pal-row button:hover span { opacity: 1; }
.nx-pal-row button.is-new { animation: nx-pal-in .5s calc(var(--i) * 50ms) both cubic-bezier(.3, 1.3, .5, 1); }
@keyframes nx-pal-in { from { transform: scaleY(.6); } }
.nx-pal-new { justify-self: center; padding: .45rem 1rem; border-radius: 999px; background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--text); font-weight: 800; font-size: .82rem; }

.nx-asp { display: grid; justify-items: center; gap: .8rem; }
.nx-asp-stage { display: grid; place-items: center; width: 12rem; height: 12rem; }
.nx-asp-box { position: relative; background: center / cover; border-radius: 10px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent), 0 10px 26px rgba(0, 0, 0, .3); transition: width .5s cubic-bezier(.3, 1.25, .5, 1), height .5s cubic-bezier(.3, 1.25, .5, 1); }
.nx-asp-box span { position: absolute; left: .4rem; top: .4rem; padding: .15rem .4rem; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .7rem; font-weight: 800; }
.nx-asp-tabs { display: flex; gap: .2rem; padding: .2rem; border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.nx-asp-tabs button { padding: .3rem .7rem; border-radius: 999px; font-size: .76rem; font-weight: 800; color: var(--muted); }
.nx-asp-tabs .is-active { background: var(--text); color: var(--bg); }

.nx-cmp { --p: 50%; position: relative; width: min(22rem, 100%); aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; user-select: none; touch-action: pan-y; cursor: ew-resize; }
.nx-cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.nx-cmp.is-mono .nx-cmp-a { filter: grayscale(1) contrast(.9) brightness(.8); }
.nx-cmp-b { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--p)); }
.nx-cmp-line { position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, .5); }
.nx-cmp-line button { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 2.2rem; height: 2.2rem; border-radius: 999px; background: #fff; color: #111; font-weight: 900; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.nx-cmp-tag { position: absolute; left: .6rem; top: .6rem; padding: .2rem .5rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .7rem; font-weight: 800; }
.nx-cmp-tag.is-r { left: auto; right: .6rem; }

.nx-cswap { position: relative; width: 14rem; height: 9.5rem; margin-top: 2rem; cursor: pointer; touch-action: pan-y; }
.nx-cswap-card { position: absolute; inset: 0; border-radius: var(--radius-lg); background: center / cover; box-shadow: 0 14px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .1); transition: transform .5s cubic-bezier(.3, 1.2, .5, 1), opacity .3s; }

.nx-deck { position: relative; width: 12rem; height: 15rem; touch-action: none; }
.nx-deck-card { position: absolute; inset: 0; border-radius: 18px; background: center / cover; box-shadow: 0 14px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .1); cursor: grab; transition: transform .45s cubic-bezier(.3, 1.2, .5, 1), opacity .3s; }
.nx-deck-card:active { cursor: grabbing; }

.nx-car { --R: 190px; width: 100%; height: 12rem; perspective: 900px; overflow: hidden; touch-action: pan-y; cursor: grab; display: grid; place-items: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.nx-car-ring { position: relative; width: 8rem; height: 9rem; transform-style: preserve-3d; }
.nx-car-card { position: absolute; inset: 0; border-radius: 14px; background: center / cover; transform: rotateY(var(--a)) translateZ(var(--R)); box-shadow: 0 10px 24px rgba(0, 0, 0, .35); backface-visibility: hidden; }

.nx-cfan { position: relative; width: 16rem; height: 11rem; }
.nx-cfan-card { --i: 0; position: absolute; left: 50%; bottom: 0; width: 6.5rem; height: 8.6rem; margin-left: -3.25rem; border-radius: 12px; background: center / cover; transform-origin: 50% 160%; transform: rotate(calc(var(--i) * 11deg)); box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .12); transition: transform .45s cubic-bezier(.3, 1.3, .5, 1), filter .3s; }
.nx-cfan-card:hover { transform: rotate(calc(var(--i) * 11deg)) translateY(-6px); }
.nx-cfan-card.is-up { transform: rotate(calc(var(--i) * 4deg)) translateY(-2.4rem) scale(1.12); z-index: 5; }
.nx-cfan.has-up .nx-cfan-card:not(.is-up) { filter: brightness(.55); }

.nx-orbit { --R: 150px; width: 100%; height: 11rem; perspective: 1000px; display: grid; place-items: center; overflow: hidden; cursor: grab; touch-action: pan-y; -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
.nx-orbit-band { position: relative; width: 7rem; height: 8rem; transform-style: preserve-3d; }
.nx-orbit-card { position: absolute; inset: 0; display: grid; align-content: end; padding: .7rem; border-radius: 14px; background: #fafafa; color: #121212; transform: rotateY(var(--a)) translateZ(var(--R)); backface-visibility: hidden; box-shadow: 0 10px 26px rgba(0, 0, 0, .3); }
.nx-orbit-card b { font-size: .9rem; }
.nx-orbit-card small { color: #777; font-size: .7rem; font-weight: 700; }

.nx-rp { display: flex; width: 100%; height: 10rem; border-radius: var(--radius-lg); overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent); }
.nx-rp.is-settling .nx-rp-pane { transition: flex-basis .35s cubic-bezier(.3, 1.3, .5, 1); }
.nx-rp-pane { flex: 0 0 auto; min-width: 0; padding: .8rem; overflow: hidden; background: color-mix(in srgb, var(--text) 3%, transparent); font-size: .8rem; }
.nx-rp-pane:nth-of-type(2) { background: color-mix(in srgb, var(--text) 5%, transparent); }
.nx-rp-pane b { display: block; margin-bottom: .3rem; white-space: nowrap; }
.nx-rp-pane p { color: var(--muted); transition: opacity .2s; }
.nx-rp-pane.is-narrow p { opacity: 0; }
.nx-rp-handle { flex: 0 0 8px; position: relative; cursor: col-resize; touch-action: none; outline: none; }
.nx-rp-handle::after { content: ""; position: absolute; left: 3px; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--text) 25%, transparent); transition: background-color .2s, top .25s, bottom .25s; }
.nx-rp-handle:hover::after, .nx-rp-handle.is-held::after, .nx-rp-handle:focus-visible::after { background: var(--purple); top: 10%; bottom: 10%; }

.nx-split { --s: 50%; display: grid; grid-template-columns: var(--s) 10px 1fr; width: 100%; height: 10rem; border-radius: var(--radius-lg); overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent); }
.nx-split > :not(.nx-split-handle) { min-width: 0; padding: .7rem; overflow: hidden; display: grid; gap: .4rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; background: color-mix(in srgb, var(--text) 3%, transparent); }
.nx-split > .is-tight { grid-template-columns: minmax(0, 1fr); }
.nx-split i.nx-split-tile { display: block; height: 2.2rem; border-radius: 8px; background: color-mix(in srgb, var(--text) 10%, transparent); transition: all .3s; }
.nx-split-handle { position: relative; cursor: col-resize; touch-action: none; background: color-mix(in srgb, var(--text) 6%, transparent); }
.nx-split-handle i { position: absolute; left: 3px; top: 40%; bottom: 40%; width: 4px; border-radius: 4px; background: color-mix(in srgb, var(--text) 35%, transparent); transition: top .25s, bottom .25s, background-color .2s; }
.nx-split-handle:hover i, .nx-split-handle.is-held i { top: 25%; bottom: 25%; background: var(--purple); }

.nx-tree { list-style: none; margin: 0; padding: 0; width: min(16rem, 100%); font-size: .85rem; }
.nx-tree ul { list-style: none; margin: 0; padding: 0 0 0 1rem; overflow: hidden; max-height: 0; transition: max-height .35s cubic-bezier(.2, .8, .2, 1); }
.nx-tree [aria-expanded="true"] > ul { max-height: 30rem; }
.nx-tree button { width: 100%; display: flex; align-items: center; gap: .3rem; padding: .3rem .4rem; border-radius: 7px; color: var(--text); text-align: left; font-weight: 600; }
.nx-tree button:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.nx-tree-file { color: var(--muted) !important; }
.nx-tree-file.is-picked { background: color-mix(in srgb, var(--purple) 20%, transparent); color: var(--text) !important; }
.nx-tree-caret { width: .8rem; font-style: normal; color: var(--muted); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.nx-tree [aria-expanded="true"] > button .nx-tree-caret { transform: rotate(90deg); }
