/* Nexus app mockups: faithful HTML/CSS recreations of the macOS app.
   All classes are nx- prefixed. Each [data-mockup] is laid out at a fixed design size (--nx-w x --nx-h)
   and scaled to its container width by mockup.js (--nx-s). Colors come from base.css tokens. */

/* ---------- palette (derived from site tokens) ---------- */
.nx-app, .nx-frag {
  --nx-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --nx-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --nx-bg: var(--bg);
  --nx-panel: var(--panel);
  --nx-elev: var(--raised);
  --nx-term: color-mix(in srgb, var(--app-blue) 3%, var(--bg));
  --nx-head: color-mix(in srgb, var(--text) 2.5%, var(--panel));
  --nx-side: color-mix(in srgb, var(--app-blue) 2.5%, var(--panel));
  --nx-f1: color-mix(in srgb, var(--text) 4.5%, transparent);
  --nx-f2: color-mix(in srgb, var(--text) 7%, transparent);
  --nx-f3: color-mix(in srgb, var(--text) 11%, transparent);
  --nx-sel: color-mix(in srgb, var(--text) 9.5%, transparent);
  --nx-line: var(--line);
  --nx-bd: var(--border);
  --nx-bd2: var(--border-strong);
  --nx-t1: var(--text);
  --nx-t2: color-mix(in srgb, var(--text) 62%, transparent);
  --nx-t3: color-mix(in srgb, var(--text) 45%, transparent);
  --nx-t4: color-mix(in srgb, var(--text) 30%, transparent);
  --nx-blue: var(--app-blue);
  --nx-blue-t: color-mix(in srgb, var(--app-blue) 62%, var(--text));
  --nx-blue-s: color-mix(in srgb, var(--app-blue) 17%, transparent);
  --nx-ok: var(--ok);
  --nx-warn: var(--warn);
  --nx-err: var(--err);
  --nx-violet: var(--violet);
  --nx-claude: #D97757; /* Claude Code mark, mockup only */
  --nx-gem: color-mix(in srgb, var(--app-blue) 55%, var(--violet));
  --nx-raise: color-mix(in srgb, var(--text) 12%, var(--panel));
  position: relative;
  display: block;
  width: 100%;
  font-family: var(--nx-ui);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--nx-t1);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- scaling stage ---------- */
.nx-app { --nx-w: 1200; --nx-h: 760; }
.nx-frag--pane { --nx-w: 560; --nx-h: 340; }
.nx-frag--failover { --nx-w: 560; --nx-h: 320; }
.nx-frag--composer { --nx-w: 640; --nx-h: 150; }
.nx-frag--capsule { --nx-w: 480; --nx-h: 160; }
.nx-frag--lineup { --nx-w: 520; --nx-h: 440; }
.nx-frag--teammates { --nx-w: 380; --nx-h: 300; }
.nx-viewport, .nx-frag { position: relative; aspect-ratio: var(--nx-w) / var(--nx-h); }
.nx-frag { max-width: calc(var(--nx-w) * 1.15px); margin-left: auto; margin-right: auto; }
.nx-stage {
  position: absolute; left: 0; top: 0;
  width: calc(var(--nx-w) * 1px); height: calc(var(--nx-h) * 1px);
  transform: scale(var(--nx-s, 1)); transform-origin: 0 0;
}
.nx-app:not(.is-ready) .nx-viewport, .nx-frag:not(.is-ready) { overflow: hidden; }
.nx-app *, .nx-frag * { box-sizing: border-box; }
.nx-app p, .nx-frag p, .nx-app ul, .nx-app li { margin: 0; padding: 0; }
.nx-app b, .nx-frag b { font-weight: 600; }
.nx-app i, .nx-frag i, .nx-app em, .nx-frag em { font-style: normal; }

/* paused / static */
.nx-paused *, .nx-paused *::before, .nx-paused *::after { animation-play-state: paused !important; }
.nx-static *, .nx-static *::before, .nx-static *::after { transition: none !important; animation: none !important; }

/* ---------- icons ---------- */
.nx-ic { display: inline-flex; flex: none; width: 14px; height: 14px; color: var(--nx-t3); }
.nx-ic svg { width: 100%; height: 100%; display: block; overflow: visible; }
.nx-ic[data-i="claude"] { color: var(--nx-claude); }
.nx-ic[data-i="codex"] { color: var(--nx-t1); }
.nx-ic[data-i="gemini"] { color: var(--nx-gem); }
.nx-ic[data-i="opencode"] { color: var(--nx-t1); }
.nx-sp { flex: 1; }

/* ---------- window ---------- */
.nx-win {
  position: absolute; inset: 0; overflow: hidden; border-radius: 12px; background: var(--nx-bg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 50px 100px -24px rgba(0,0,0,.8), 0 20px 44px -16px rgba(0,0,0,.55);
}
.nx-win::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 30;
  box-shadow: inset 0 0 0 1px var(--nx-bd), inset 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent);
}

/* title bar */
.nx-titlebar { position: relative; z-index: 5; height: 44px; display: flex; align-items: center; padding: 0 12px 0 16px; background: color-mix(in srgb, var(--panel) 55%, var(--bg)); }
.nx-titlebar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 248px; background: var(--nx-side); border-right: 1px solid var(--nx-line); }
.nx-titlebar::after { content: ""; position: absolute; left: 248px; right: 0; bottom: 0; height: 1px; background: var(--nx-line); }
.nx-tb-left, .nx-tb-right { position: relative; display: flex; align-items: center; gap: 2px; }
.nx-tb-left { width: 220px; }
.nx-lights { display: flex; gap: 8px; margin-right: 18px; }
.nx-lights i { width: 12px; height: 12px; border-radius: 50%; background: var(--err); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.25); }
.nx-lights i:nth-child(2) { background: #FEBC2E; }
.nx-lights i:nth-child(3) { background: #28C840; }
.nx-mark { width: 16px; height: 16px; border-radius: 4px; margin-right: 7px; }
.nx-appname { font-size: 13px; font-weight: 600; margin-right: auto; }
.nx-tb-right { margin-left: auto; gap: 2px; }
.nx-tbtn { width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nx-tbtn .nx-ic { width: 15px; height: 15px; color: var(--nx-t2); }
.nx-tbtn.is-on { background: var(--nx-f2); }
.nx-tbtn.is-on .nx-ic { color: var(--nx-t1); }
.nx-tbtn--sm { width: 24px; height: 24px; }
.nx-tbtn--sm .nx-ic { width: 13px; height: 13px; }
.nx-tb-sep { width: 1px; height: 16px; background: var(--nx-bd); margin: 0 6px; }
.nx-usage { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--nx-f1); font-size: 11px; font-weight: 500; color: var(--nx-t2); font-variant-numeric: tabular-nums; margin: 0 4px; }
.nx-usage__bars { display: flex; flex-direction: column; gap: 2px; }
.nx-usage__bars i { position: relative; width: 26px; height: 3px; border-radius: 2px; background: var(--nx-f3); overflow: hidden; }
.nx-usage__bars i::after { content: ""; position: absolute; inset: 0; background: var(--nx-ok); transform-origin: 0 50%; transform: scaleX(var(--u)); }
.nx-orb {
  width: 18px; height: 18px; border-radius: 50%; margin: 0 5px; flex: none;
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--violet) 25%, var(--text)) 0, var(--violet) 38%, color-mix(in srgb, var(--app-blue) 80%, var(--bg)) 100%);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.25), 0 0 0 .5px color-mix(in srgb, var(--text) 18%, transparent), 0 2px 8px color-mix(in srgb, var(--app-blue) 28%, transparent);
}
.nx-orb--lg { width: 28px; height: 28px; margin: 0; }
.nx-is-listening .nx-tb-right .nx-orb, .nx-capsule.is-in .nx-orb { animation: nxBreathe 1.6s ease-in-out infinite; }
.nx-bell { position: relative; }
.nx-bell::after { content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--nx-blue); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--panel) 55%, var(--bg)); }

/* segmented mode switcher (the only interactive part) */
.nx-seg { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; padding: 2px; height: 28px; border-radius: 8px; background: var(--nx-f2); box-shadow: inset 0 0 0 .5px var(--nx-line); }
.nx-seg__thumb { position: absolute; left: 2px; top: 2px; width: 80px; height: 24px; border-radius: 6px; background: var(--nx-raise); box-shadow: 0 1px 2px rgba(0,0,0,.5), inset 0 .5px 0 color-mix(in srgb, var(--text) 12%, transparent); transition: transform .3s cubic-bezier(.3,.8,.2,1); }
.nx-app[data-mode="code"] .nx-seg__thumb { transform: translateX(80px); }
.nx-app[data-mode="work"] .nx-seg__thumb { transform: translateX(160px); }
.nx-seg button {
  position: relative; z-index: 1; appearance: none; -webkit-appearance: none; margin: 0; border: 0; background: none;
  width: 80px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 12px/1 var(--nx-ui); color: var(--nx-t2); cursor: pointer; transition: color .15s ease-out, background-color .15s ease-out;
}
.nx-seg button .nx-ic { width: 13px; height: 13px; color: currentColor; }
.nx-seg button:hover { color: var(--nx-t1); background: var(--nx-f1); }
.nx-seg button:active { background: var(--nx-f2); }
.nx-seg button[aria-selected="true"] { color: var(--nx-t1); background: none; }
.nx-seg button:focus-visible { outline: 2px solid var(--nx-blue); outline-offset: 1px; }
.nx-small .nx-seg { pointer-events: none; }

/* full-size switcher shown under the window on small screens */
.nx-modes { display: none; justify-content: center; gap: 4px; margin: 16px auto 0; padding: 4px; width: max-content; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.nx-small .nx-modes { display: flex; }
.nx-modes button {
  appearance: none; -webkit-appearance: none; margin: 0; border: 0; background: none; cursor: pointer;
  min-width: 84px; min-height: 44px; padding: 0 14px; border-radius: 7px;
  font: 500 13px/1 "IBM Plex Mono", ui-monospace, monospace; color: var(--text-2);
  transition: color .15s ease-out, background-color .15s ease-out, transform .22s cubic-bezier(.3,1.5,.5,1);
}
.nx-modes button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.nx-modes button:active { transform: scale(.97); }
.nx-modes button[aria-selected="true"] { color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--border); }
.nx-modes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- body, views ---------- */
.nx-body { position: absolute; top: 44px; left: 0; right: 0; bottom: 0; }
.nx-body::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 248px; background: var(--nx-side); border-right: 1px solid var(--nx-line); }
.nx-view { position: absolute; inset: 0; display: flex; opacity: 0; visibility: hidden; transform: translateY(3px); transition: opacity .24s ease, transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear .3s; }
.nx-app[data-mode="code"] .nx-view[data-view="code"],
.nx-app[data-mode="work"] .nx-view[data-view="work"],
.nx-app[data-mode="agent"] .nx-view[data-view="agent"] { opacity: 1; visibility: visible; transform: none; transition: opacity .28s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
.nx-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* sidebar */
.nx-side { position: relative; width: 248px; flex: none; display: flex; flex-direction: column; padding: 8px 8px 8px; }
.nx-side__head { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 6px 0 8px; font-size: 12px; font-weight: 600; color: var(--nx-t2); }
.nx-side__head .nx-ic { width: 14px; height: 14px; }
.nx-side__label { padding: 14px 8px 5px; font-size: 11px; font-weight: 600; color: var(--nx-t3); }
.nx-row { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px 0 6px; border-radius: 7px; font-size: 13px; color: var(--nx-t1); white-space: nowrap; }
.nx-row--sm { height: 26px; font-size: 12.5px; color: var(--nx-t2); padding-left: 10px; }
.nx-row.is-sel { background: var(--nx-sel); }
.nx-chev { width: 11px; height: 11px; color: var(--nx-t4); }
.nx-row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nx-row__meta { font-size: 11px; color: var(--nx-t3); }
.nx-sub { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px 0 32px; border-radius: 7px; font-size: 12.5px; color: var(--nx-t2); }
.nx-sub .nx-ic { width: 13px; height: 13px; }
.nx-sub span { flex: 1; }
.nx-sub em { font-size: 10.5px; font-weight: 500; color: var(--nx-warn); opacity: 0; transform: translateX(4px); transition: opacity .2s, transform .2s; }
.nx-sub[data-status="needs"] em { opacity: 1; transform: none; }
.nx-sub[data-status="needs"] { color: var(--nx-t1); }
.nx-search { display: flex; align-items: center; gap: 7px; height: 28px; margin: 2px 0 8px; padding: 0 9px; border-radius: 7px; background: var(--nx-f1); box-shadow: inset 0 0 0 .5px var(--nx-line); font-size: 12.5px; color: var(--nx-t3); }
.nx-search .nx-ic { width: 13px; height: 13px; }
.nx-work { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 32px; border-radius: 7px; font-size: 12.5px; color: var(--nx-t2); }
.nx-work.is-sel { background: var(--nx-sel); color: var(--nx-t1); }
.nx-work__name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nx-work__t { font-size: 11px; color: var(--nx-t3); }
.nx-user { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 10px 8px 2px; border-top: 1px solid var(--nx-line); }
.nx-user__txt { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.nx-user__txt b { font-size: 12.5px; font-weight: 600; }
.nx-user__txt span { font-size: 11px; color: var(--nx-t3); }

/* status dots */
.nx-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--nx-t4); transition: background-color .3s; }
[data-status="working"] > .nx-dot, .nx-dot[data-status="working"] { background: var(--nx-blue); }
[data-status="needs"] > .nx-dot, .nx-dot[data-status="needs"] { background: var(--nx-warn); }
[data-status="done"] > .nx-dot, .nx-dot[data-status="done"] { background: var(--nx-ok); }
[data-status="working"] > .nx-dot::after, .nx-dot[data-status="working"]::after,
[data-status="needs"] > .nx-dot::after, .nx-dot[data-status="needs"]::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid currentColor; opacity: 0;
  animation: nxPing 1.8s cubic-bezier(.2,.6,.3,1) infinite;
}
[data-status="working"] > .nx-dot, .nx-dot[data-status="working"] { color: var(--nx-blue); }
[data-status="needs"] > .nx-dot, .nx-dot[data-status="needs"] { color: var(--nx-warn); }

/* avatars */
.nx-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 650; letter-spacing: .02em; }
.nx-av--violet { background: color-mix(in srgb, var(--violet) 24%, var(--panel)); color: color-mix(in srgb, var(--violet) 70%, var(--text)); }
.nx-av--blue { background: color-mix(in srgb, var(--app-blue) 24%, var(--panel)); color: color-mix(in srgb, var(--app-blue) 60%, var(--text)); }
.nx-av--green { background: color-mix(in srgb, var(--ok) 20%, var(--panel)); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.nx-av--ghost { background: none; box-shadow: inset 0 0 0 1px var(--nx-bd); }
.nx-av--lg { width: 34px; height: 34px; font-size: 12px; }
.nx-user .nx-av { width: 26px; height: 26px; font-size: 10px; }

/* ---------- code view ---------- */
.nx-tabs { display: flex; align-items: center; gap: 2px; height: 38px; padding: 0 8px; border-bottom: 1px solid var(--nx-line); }
.nx-tab { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 9px 0 10px; border-radius: 7px; font-size: 12.5px; color: var(--nx-t2); white-space: nowrap; }
.nx-tab .nx-ic { width: 13px; height: 13px; }
.nx-tab small { font-size: 10.5px; color: var(--nx-t3); padding: 1px 5px; border-radius: 5px; background: var(--nx-f2); }
.nx-tab.is-on { background: var(--nx-f2); color: var(--nx-t1); box-shadow: inset 0 0 0 .5px var(--nx-line); }
.nx-tab__x { width: 10px !important; height: 10px !important; margin-left: 2px; }
.nx-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; padding: 8px; }

/* pane */
.nx-pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border-radius: 10px; background: var(--nx-term); border: 1px solid var(--nx-line); }
.nx-pane.is-focused { border-color: color-mix(in srgb, var(--app-blue) 42%, transparent); }
.nx-pane--solo { position: absolute; inset: 10px; border-color: var(--nx-bd); box-shadow: 0 24px 60px -18px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.5); }
.nx-pane__head { position: relative; z-index: 3; flex: none; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 9px; background: var(--nx-head); border-bottom: 1px solid var(--nx-line); white-space: nowrap; }
.nx-pane__head > .nx-ic { width: 12px; height: 12px; }
.nx-pane__head > .nx-ic:first-child { width: 13px; height: 13px; margin-right: 1px; }
.nx-pane__head > .nx-ic:not(:first-child) { color: var(--nx-t4); margin: 0 2px; }
.nx-pane__title { font-size: 12px; font-weight: 600; }
.nx-pane__sub { font-size: 11px; color: var(--nx-t3); margin-right: 2px; }
.nx-ring { width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; flex: none;
  background: conic-gradient(var(--nx-blue) calc(var(--p) * 360deg), var(--nx-f3) 0);
  -webkit-mask: radial-gradient(circle, transparent 3.2px, #000 3.6px); mask: radial-gradient(circle, transparent 3.2px, #000 3.6px); }

/* terminal */
.nx-term { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 12px 9px; font: 400 11.5px/1.55 var(--nx-mono); color: color-mix(in srgb, var(--text) 88%, transparent); font-variant-ligatures: none; }
.nx-term__lines { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; -webkit-mask-image: linear-gradient(transparent, #000 26px); mask-image: linear-gradient(transparent, #000 26px); }
.t-line { flex: none; min-height: 1.55em; white-space: pre-wrap; word-break: break-word; padding-left: 2ch; text-indent: -2ch; animation: nxIn .18s ease-out; }
.t-line.nb { padding-left: 0; text-indent: 0; }
.t-dim { color: var(--nx-t3); }
.t-2 { color: var(--nx-t2); }
.t-b { color: var(--nx-t1); font-weight: 600; }
.t-ok { color: var(--nx-ok); }
.t-err { color: color-mix(in srgb, var(--err) 85%, var(--text)); }
.t-warn { color: var(--nx-warn); }
.t-acc { color: var(--nx-blue-t); }
.t-vi { color: color-mix(in srgb, var(--violet) 80%, var(--text)); }
.t-cl { color: var(--nx-claude); }
.t-gem { color: var(--nx-gem); }
.t-user { color: var(--nx-t2); }
.t-line.t-add, .t-line.t-del { margin-left: 5ch; padding-left: 1ch; text-indent: 0; white-space: pre; overflow: hidden; text-overflow: ellipsis; border-radius: 2px; }
.t-line.t-add { background: color-mix(in srgb, var(--ok) 11%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.t-line.t-del { background: color-mix(in srgb, var(--err) 12%, transparent); color: color-mix(in srgb, var(--err) 65%, var(--text)); }
.t-ln { opacity: .55; }
.t-box { display: inline-block; text-indent: 0; padding: 1px 10px; border: 1px solid var(--nx-bd2); border-radius: 5px; margin: 2px 0; }
.t-codex-head { display: inline-flex; flex-direction: column; text-indent: 0; padding: 4px 12px; border: 1px solid var(--nx-bd2); border-radius: 5px; margin-bottom: 2px; }
.t-rule { display: flex; align-items: center; gap: 1ch; color: var(--nx-t3); text-indent: 0; padding-left: 0; }
.t-rule::after { content: ""; flex: 1; height: 1px; background: var(--nx-bd); }
.t-ask { display: block; text-indent: 0; padding: 4px 10px 5px; border: 1px solid color-mix(in srgb, var(--nx-claude) 55%, transparent); border-radius: 6px; margin: 3px 0; }
.t-ask__opt { color: var(--nx-t2); }
.t-ask__opt.is-on { color: var(--nx-blue-t); }
.t-ask.is-chosen .t-ask__opt.is-on { color: var(--nx-ok); }
.t-shim { background: linear-gradient(90deg, var(--nx-t2) 0 40%, var(--nx-t1) 50%, var(--nx-t2) 60% 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: nxShim 1.8s linear infinite; }
.t-spin { display: inline-block; width: 1.4ch; height: 1.55em; overflow: hidden; vertical-align: top; text-indent: 0; }
.t-spin > span { display: flex; flex-direction: column; animation: nxSpin 1s steps(10) infinite; }
.t-spin > span > b { height: 1.55em; font-weight: 400; }
.nx-term__prompt { flex: none; }
.nx-term__prompt.is-busy { display: none; }
.t-pbox { display: flex; align-items: center; margin-top: 6px; padding: 4px 9px; border: 1px solid var(--nx-bd2); border-radius: 6px; white-space: pre; min-height: calc(1.55em + 10px); }
.t-pline { display: flex; align-items: center; margin-top: 4px; white-space: pre; min-height: 1.55em; }
.t-ph { color: var(--nx-t4); margin-left: 1ch; }
.t-input:not(:empty) ~ .t-ph { display: none; }
.t-hint { display: flex; justify-content: space-between; gap: 2ch; padding: 3px 2px 0; font-size: 10.5px; color: var(--nx-t3); white-space: nowrap; overflow: hidden; }
.t-caret, .nx-caret { display: inline-block; flex: none; width: .6em; height: 1.2em; vertical-align: -.22em; background: var(--nx-t1); opacity: .8; animation: nxBlink 1.06s steps(1) infinite; }
.nx-caret { width: 1.5px; height: 1.15em; margin-left: 1px; background: var(--nx-blue); opacity: 1; }

/* failover banner */
.nx-banner { position: absolute; z-index: 2; left: 0; right: 0; top: 26px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; font: 12px/1.3 var(--nx-ui); color: var(--nx-t1); background: color-mix(in srgb, var(--warn) 11%, var(--panel)); border-bottom: 1px solid color-mix(in srgb, var(--warn) 26%, transparent); transform: translateY(-110%); opacity: 0; transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .22s ease; }
.nx-banner.is-in { transform: none; opacity: 1; }
.nx-banner .nx-ic { width: 14px; height: 14px; color: var(--nx-warn); }
.nx-banner__msg { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-banner__msg--done, .nx-banner .nx-ic[data-i="check"] { display: none; }
.nx-banner.is-done .nx-banner__msg--done { display: block; }
.nx-banner.is-done .nx-banner__msg:not(.nx-banner__msg--done), .nx-banner.is-done .nx-ic[data-i="warn"] { display: none; }
.nx-banner.is-done .nx-ic[data-i="check"] { display: inline-flex; color: var(--nx-ok); }
.nx-banner.is-done { background: color-mix(in srgb, var(--ok) 9%, var(--panel)); border-bottom-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.nx-banner.is-done .nx-btn { opacity: 0; }

/* buttons, chips */
.nx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; height: 22px; padding: 0 10px; border-radius: 6px; font: 500 11.5px/1 var(--nx-ui); color: var(--nx-t1); background: var(--nx-f3); box-shadow: inset 0 0 0 .5px var(--nx-bd), 0 1px 1px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,1.6,.5,1), filter .15s, opacity .2s; }
.nx-btn--blue { background: var(--nx-blue); color: white; box-shadow: inset 0 .5px 0 color-mix(in srgb, white 25%, transparent), 0 1px 2px rgba(0,0,0,.3); }
.nx-btn--ghost { background: none; box-shadow: none; color: var(--nx-t2); padding: 0 4px; }
.nx-btn.is-pressed { transform: scale(.94); filter: brightness(1.25); }
.nx-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 12px; font-size: 11.5px; color: var(--nx-t2); box-shadow: inset 0 0 0 1px var(--nx-bd); white-space: nowrap; }
.nx-chip .nx-ic { width: 12px; height: 12px; }
.nx-chip--blue { color: var(--nx-blue-t); background: var(--nx-blue-s); box-shadow: none; }
.nx-chip--blue .nx-ic { color: var(--nx-blue-t); }
.nx-tag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.nx-tag--warn { color: var(--nx-warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.nx-tag--ok { color: var(--nx-ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.nx-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; color: var(--nx-t2); box-shadow: inset 0 0 0 1px var(--nx-bd); margin-left: 2px; }
.nx-plus { color: var(--nx-ok); font: 500 11.5px var(--nx-mono); }
.nx-minus { color: color-mix(in srgb, var(--err) 85%, var(--text)); font: 500 11.5px var(--nx-mono); }

/* ---------- work view ---------- */
.nx-mainhead { flex: none; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 22px; border-bottom: 1px solid var(--nx-line); }
.nx-mainhead--tall { height: 58px; gap: 12px; padding-left: 24px; border-bottom: 0; }
.nx-mainhead__title { font-size: 14px; font-weight: 600; }
.nx-convo { flex: 1; min-height: 0; overflow: hidden; padding: 22px 24px 8px; }
.nx-col { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.nx-bubble { align-self: flex-end; max-width: 78%; padding: 9px 14px; border-radius: 18px; background: color-mix(in srgb, var(--text) 9%, var(--panel)); font-size: 13px; line-height: 1.45; }
.nx-reply { font-size: 13px; line-height: 1.62; }
.nx-reply p + ul { margin-top: 8px; }
.nx-reply ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.nx-reply li { position: relative; padding-left: 16px; }
.nx-reply li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 4px; height: 4px; border-radius: 50%; background: var(--nx-t3); }
.nx-reply code, .nx-frag code { font: 12px var(--nx-mono); padding: 1px 5px; border: 0; border-radius: 4px; background: var(--nx-f2); color: var(--nx-t1); white-space: nowrap; }
.nx-w { transition: opacity .2s ease-out; }
.nx-streaming .nx-w:not(.is-on) { opacity: 0; }
[data-after] { transition: opacity .3s ease, transform .35s cubic-bezier(.2,.8,.2,1); }
.nx-hold [data-after] { opacity: 0; transform: translateY(6px); }
.nx-changes { border-radius: 10px; background: var(--nx-panel); box-shadow: inset 0 0 0 1px var(--nx-bd); overflow: hidden; }
.nx-changes__head { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; font-size: 12.5px; border-bottom: 1px solid var(--nx-line); }
.nx-changes__head .nx-ic { width: 13px; height: 13px; }
.nx-changes__row { display: flex; align-items: center; gap: 8px; height: 27px; padding: 0 12px 0 33px; font: 11.5px var(--nx-mono); color: var(--nx-t2); }
.nx-changes__row + .nx-changes__row { border-top: 1px solid var(--nx-line); }
.nx-changes__row span:first-child { flex: 1; }
.nx-meta { display: flex; align-items: center; gap: 12px; margin-top: -4px; font-size: 11.5px; color: var(--nx-t3); }
.nx-meta .nx-ic { width: 13px; height: 13px; }

/* composer */
.nx-composer { flex: none; width: 640px; margin: 4px auto 18px; padding: 12px 10px 8px 14px; border-radius: 14px; background: var(--nx-panel); box-shadow: inset 0 0 0 1px var(--nx-bd), 0 10px 30px -8px rgba(0,0,0,.55); }
.nx-composer--solo { position: absolute; left: 10px; right: 10px; top: 14px; width: auto; margin: 0; box-shadow: inset 0 0 0 1px var(--nx-bd), 0 24px 50px -16px rgba(0,0,0,.8); }
.nx-composer--slim { margin-bottom: 16px; }
.nx-composer__text { display: flex; align-items: center; flex-wrap: wrap; min-height: 42px; align-content: flex-start; font-size: 13.5px; line-height: 22px; white-space: pre; }
.nx-composer--slim .nx-composer__text { min-height: 26px; }
.nx-ph { color: var(--nx-t4); }
.nx-mention { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 6px 0 5px; border-radius: 5px; background: var(--nx-blue-s); color: var(--nx-blue-t); font-size: 12.5px; font-weight: 500; transition: opacity .2s, transform .3s cubic-bezier(.3,1.5,.5,1); }
.nx-mention::before { content: "@"; order: 1; margin-right: -3px; display: none; }
.nx-mention .nx-ic { width: 12px; height: 12px; color: var(--nx-blue-t); }
.nx-hold-m .nx-mention { display: none; }
.nx-mention { animation: nxPop .32s cubic-bezier(.3,1.5,.5,1); }
.nx-streaming li:not(:has(.is-on))::before { opacity: 0; }
.nx-composer__bar { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.nx-composer__bar .nx-tbtn { width: 26px; height: 26px; }
.nx-engine { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 7px; font-size: 12px; color: var(--nx-t2); white-space: nowrap; }
.nx-engine .nx-ic { width: 12px; height: 12px; }
.nx-engine .nx-ic:last-child { width: 10px; height: 10px; color: var(--nx-t3); }
.nx-composer .nx-engine { background: var(--nx-f1); margin-right: 2px; }
.nx-send { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--nx-blue); margin-left: 2px; transition: transform .22s cubic-bezier(.3,1.6,.5,1), filter .15s; }
.nx-send .nx-ic { width: 14px; height: 14px; color: white; }
.nx-send.is-pressed { transform: scale(.88); filter: brightness(1.25); }
.nx-composer--slim .nx-send { background: var(--nx-f3); }
.nx-composer--slim .nx-send .nx-ic { color: var(--nx-t3); }

/* ---------- agent view ---------- */
.nx-mate { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px 0 8px; border-radius: 8px; }
.nx-mate.is-sel { background: var(--nx-sel); }
.nx-mate__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.nx-mate__txt b { font-size: 13px; font-weight: 500; }
.nx-mate__txt span { font-size: 11.5px; color: var(--nx-t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-mate--add .nx-mate__txt b { color: var(--nx-t2); }
.nx-ag__who { display: flex; flex-direction: column; line-height: 1.3; }
.nx-ag__who b { font-size: 15px; }
.nx-ag__who span { font-size: 12px; color: var(--nx-t3); }
.nx-ag__chips { flex: none; display: flex; gap: 6px; padding: 0 24px 12px; border-bottom: 1px solid var(--nx-line); }
.nx-ag__body { flex: 1; min-height: 0; display: flex; }
.nx-ag .nx-convo { padding-top: 18px; }
.nx-ag .nx-col { max-width: 560px; }
.nx-ag .nx-composer { width: auto; margin: 0 16px 14px; }
.nx-sysline { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--nx-t3); }
.nx-sysline .nx-ic { width: 12px; height: 12px; }
.nx-sysline::before, .nx-sysline::after { content: ""; flex: 1; height: 1px; background: var(--nx-line); }
.nx-prs { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--nx-bd); background: var(--nx-panel); }
.nx-pr { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px 0 12px; font-size: 12.5px; }
.nx-pr + .nx-pr { border-top: 1px solid var(--nx-line); }
.nx-pr .nx-ic { width: 13px; height: 13px; }
.nx-pr__n { font: 11.5px var(--nx-mono); color: var(--nx-t3); }
.nx-pr__t { flex: 1; }
.nx-tool { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 6px; border-radius: 13px; background: var(--nx-f1); box-shadow: inset 0 0 0 1px var(--nx-line); font-size: 11.5px; color: var(--nx-t2); margin-top: -4px; }
.nx-tool b { color: var(--nx-t1); font-weight: 500; }
.nx-tool__ic { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ok) 18%, transparent); }
.nx-tool__ic .nx-ic { width: 10px; height: 10px; color: var(--nx-ok); }
.nx-mem { width: 236px; flex: none; padding: 16px 16px; border-left: 1px solid var(--nx-line); display: flex; flex-direction: column; gap: 6px; }
.nx-mem__h { font-size: 11px; font-weight: 600; color: var(--nx-t3); margin: 2px 0 2px; }
.nx-mem__h + .nx-mem__i { margin-top: 0; }
.nx-mem__i { position: relative; padding: 7px 10px 7px 10px; border-radius: 8px; background: var(--nx-f1); font-size: 12px; line-height: 1.35; color: var(--nx-t2); }
.nx-mem__i + .nx-mem__h { margin-top: 12px; }
.nx-mem__card { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px; border-radius: 8px; background: var(--nx-blue-s); font-size: 12px; color: var(--nx-t2); line-height: 1.4; }
.nx-mem__card b { display: flex; align-items: center; gap: 6px; color: var(--nx-blue-t); font-weight: 600; }
.nx-mem__card .nx-ic { width: 12px; height: 12px; color: var(--nx-blue-t); }

/* ---------- assistant capsule ---------- */
.nx-capsule { position: absolute; z-index: 20; top: 52px; left: 50%; width: 460px; margin-left: -230px; display: flex; flex-direction: column; align-items: center; pointer-events: none; opacity: 0; transform: translateY(-10px) scale(.96); transition: opacity .22s ease, transform .4s cubic-bezier(.2,1.2,.3,1); }
.nx-capsule.is-in { opacity: 1; transform: none; }
.nx-capsule--solo { top: 14px; left: 20px; right: 20px; width: auto; margin-left: 0; }
.nx-capsule__card { align-self: stretch; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 18px; background: var(--nx-elev); box-shadow: inset 0 0 0 1px var(--nx-bd), inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent), 0 22px 50px -12px rgba(0,0,0,.85), 0 6px 16px rgba(0,0,0,.4); }
.nx-capsule__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nx-capsule__eyebrow { font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--nx-blue-t); }
.nx-capsule[data-phase="working"] .nx-capsule__eyebrow { color: var(--nx-t3); }
.nx-capsule[data-phase="done"] .nx-capsule__eyebrow { color: var(--nx-ok); }
.nx-capsule__line { display: flex; align-items: center; min-height: 20px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.nx-capsule[data-phase="done"] .nx-capsule__line .nx-caret, .nx-capsule[data-phase="working"] .nx-capsule__line .nx-caret { display: none; }
.nx-wave { display: flex; align-items: center; gap: 2.5px; height: 18px; }
.nx-wave i { width: 2.5px; height: 18px; border-radius: 2px; background: var(--nx-blue-t); transform: scaleY(.2); animation: nxWave 1s ease-in-out infinite; }
.nx-wave i:nth-child(2) { animation-delay: -.2s; } .nx-wave i:nth-child(3) { animation-delay: -.45s; }
.nx-wave i:nth-child(4) { animation-delay: -.1s; } .nx-wave i:nth-child(5) { animation-delay: -.65s; }
.nx-capsule:not([data-phase="listening"]) .nx-wave i { animation: none; transform: scaleY(.2); opacity: .5; }
.nx-capsule__chips { display: flex; flex-wrap: nowrap; white-space: nowrap; justify-content: center; gap: 6px; margin-top: 8px; min-height: 26px; }
.nx-act { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px 0 7px; border-radius: 13px; background: var(--nx-elev); box-shadow: inset 0 0 0 1px var(--nx-bd), 0 8px 20px -8px rgba(0,0,0,.7); font-size: 12px; color: var(--nx-t2); opacity: 0; transform: translateY(-4px) scale(.95); transition: opacity .2s, transform .3s cubic-bezier(.2,1.3,.3,1), color .2s; }
.nx-act.is-in { opacity: 1; transform: none; }
.nx-act.is-done { color: var(--nx-t1); }
.nx-act__ic { position: relative; width: 14px; height: 14px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.nx-act__ic::before { content: ""; position: absolute; inset: 1px; border-radius: 50%; border: 1.5px solid var(--nx-f3); border-top-color: var(--nx-blue-t); animation: nxRot .7s linear infinite; }
.nx-act__ic .nx-ic { width: 9px; height: 9px; color: var(--nx-ok); opacity: 0; transform: scale(.5); transition: opacity .2s, transform .3s cubic-bezier(.3,1.6,.5,1); }
.nx-act.is-done .nx-act__ic { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.nx-act.is-done .nx-act__ic::before { display: none; }
.nx-act.is-done .nx-act__ic .nx-ic { opacity: 1; transform: none; }

/* ---------- lineup sheet ---------- */
.nx-sheet { position: absolute; inset: 10px; display: flex; flex-direction: column; padding: 20px 20px 16px; border-radius: 12px; background: var(--nx-elev); box-shadow: inset 0 0 0 1px var(--nx-bd), inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent), 0 30px 70px -20px rgba(0,0,0,.85); }
.nx-sheet__title { font-size: 15px; font-weight: 600; }
.nx-sheet__sub { font-size: 12px; color: var(--nx-t3); margin-top: 3px; }
.nx-sheet__sub b { color: var(--nx-t2); font-weight: 500; }
.nx-lu { margin-top: 14px; border-radius: 10px; background: var(--nx-f1); box-shadow: inset 0 0 0 1px var(--nx-line); }
.nx-lu__row { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 12px; transition: opacity .25s; }
.nx-lu__row + .nx-lu__row { border-top: 1px solid var(--nx-line); }
.nx-lu__row.is-zero { opacity: .45; }
.nx-lu__row > .nx-ic { width: 15px; height: 15px; }
.nx-lu__name { flex: 1; font-size: 13px; }
.nx-select { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; width: 104px; height: 24px; padding: 0 6px 0 9px; border-radius: 6px; background: var(--nx-f2); box-shadow: inset 0 0 0 .5px var(--nx-bd); font-size: 12px; color: var(--nx-t2); }
.nx-select .nx-ic { width: 10px; height: 10px; }
.nx-step { display: inline-flex; align-items: center; height: 24px; border-radius: 6px; background: var(--nx-f2); box-shadow: inset 0 0 0 .5px var(--nx-bd); }
.nx-step > span { width: 24px; text-align: center; font-size: 13px; color: var(--nx-t2); transition: background-color .15s, color .15s; border-radius: 6px; }
.nx-step > span.is-pressed { background: var(--nx-f3); color: var(--nx-t1); }
.nx-step > b { width: 22px; text-align: center; font: 500 12.5px var(--nx-mono); font-variant-numeric: tabular-nums; }
.nx-lu__toggle { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 0 2px; }
.nx-lu__tt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nx-lu__tt b { font-size: 13px; font-weight: 500; }
.nx-lu__tt span { font: 11px var(--nx-mono); color: var(--nx-t3); transition: opacity .25s; }
.nx-lu__toggle:not(:has(.is-on)) .nx-lu__tt span { opacity: .35; }
.nx-switch { position: relative; width: 32px; height: 19px; border-radius: 10px; background: var(--nx-f3); flex: none; transition: background-color .22s; }
.nx-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.4); transition: transform .26s cubic-bezier(.3,1.4,.5,1); }
.nx-switch.is-on { background: var(--nx-blue); }
.nx-switch.is-on::after { transform: translateX(13px); }
.nx-lu__field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; font-size: 12px; color: var(--nx-t3); }
.nx-input { display: flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 7px; background: var(--nx-f1); box-shadow: inset 0 0 0 1px var(--nx-bd); font-size: 12.5px; color: var(--nx-t1); }
.nx-sheet__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.nx-sheet__foot .nx-btn { height: 28px; padding: 0 14px; font-size: 12.5px; }
.nx-sheet__foot .nx-btn--ghost { padding: 0 4px; }
.nx-sheet__foot b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- teammates card ---------- */
.nx-card { position: absolute; inset: 10px; padding: 8px; border-radius: 12px; background: var(--nx-side); box-shadow: inset 0 0 0 1px var(--nx-bd), 0 24px 60px -20px rgba(0,0,0,.8); display: flex; flex-direction: column; gap: 1px; }

/* ---------- keyframes ---------- */
@keyframes nxIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes nxBlink { 0%, 50% { opacity: .85; } 50.01%, 100% { opacity: 0; } }
@keyframes nxSpin { to { transform: translateY(-100%); } }
@keyframes nxRot { to { transform: rotate(360deg); } }
@keyframes nxPing { 0% { opacity: .55; transform: scale(.6); } 80%, 100% { opacity: 0; transform: scale(1.5); } }
@keyframes nxShim { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes nxWave { 0%, 100% { transform: scaleY(.2); } 50% { transform: scaleY(1); } }
@keyframes nxPop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes nxBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

@media (prefers-reduced-motion: reduce) {
  .nx-app *, .nx-frag *, .nx-app *::before, .nx-frag *::before, .nx-app *::after, .nx-frag *::after { animation: none !important; transition: none !important; }
}
