/* ==========================================================================
   Product demo (.nxd) — homepage only
   --------------------------------------------------------------------------
   A scripted replica of the macOS app, driven by initDemo() in home.js.

   .nxd-app is laid out on a fixed 1200×772 canvas: the point size of the
   real window the reference screenshots were captured from, so every size
   below is in the app's own points. home.js sets --nxd-scale to
   stageWidth / 1200 and the canvas is transformed down uniformly; nothing
   inside reflows between breakpoints.

   Palette tokens are the app's adaptive colours (ContentView.swift,
   `extension Color`), light and dark, switched by [data-appearance] on
   .nxd-screen. Everything is namespaced .nxd-* so it cannot collide with
   the rest of the site.
   ========================================================================== */

.nxd { padding: 72px 0 96px; scroll-margin-top: 80px; }

/* ---- Scene pills ------------------------------------------------------- */
.nxd-pills {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0 auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nxd-pills::-webkit-scrollbar { display: none; }
.nxd-pill {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--nx-text-2);
  background: transparent;
  transition: color .2s var(--nx-ease), background .2s var(--nx-ease);
  overflow: hidden;
}
.nxd-pill:hover { color: var(--nx-text); background: var(--nx-surface); }
.nxd-pill:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.nxd-pill.is-active { color: var(--nx-text); }
.nxd-pill-num {
  font-family: var(--nx-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--nx-text-3);
}
.nxd-pill.is-active .nxd-pill-num { color: var(--nx-brand-2); }
.nxd-pill-fill {
  position: absolute;
  left: 16px; right: 16px; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--nx-border);
  overflow: hidden;
}
.nxd-pill-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--c-primary);
  transform: scaleX(0);
  transform-origin: left center;
}
.nxd-pill.is-done .nxd-pill-fill::after { transform: scaleX(1); opacity: .35; }
.nxd-pill.is-active .nxd-pill-fill::after {
  animation: nxd-fill var(--nxd-dwell, 8000ms) linear forwards;
}
.nxd-pill.is-active.is-paused .nxd-pill-fill::after { animation-play-state: paused; }
.nxd-pill.is-static .nxd-pill-fill::after { animation: none; transform: scaleX(1); }
@keyframes nxd-fill { to { transform: scaleX(1); } }

/* ---- Stage + window ---------------------------------------------------- */
.nxd-stage {
  position: relative;
  max-width: 1128px;
  margin: 22px auto 0;
}
.nxd-stage::before {
  content: "";
  position: absolute;
  left: 10%; right: 10%; bottom: -36px; height: 80px;
  background: radial-gradient(ellipse at center, rgba(56, 122, 224, .28) 0%, transparent 70%);
  filter: blur(24px);
  z-index: -1;
}
.nxd-screen {
  --nxd-scale: .94;
  position: relative;
  aspect-ratio: 1200 / 772;
  border-radius: calc(24px * var(--nxd-scale));
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--nx-border-2),
    0 40px 90px -24px rgba(0, 0, 0, .75),
    0 12px 32px rgba(0, 0, 0, .35);
}

/* ---- Palette ----------------------------------------------------------- */
[data-theme="light"] .nxd-screen {
  box-shadow:
    0 0 0 1px var(--nx-border-2),
    0 30px 70px -24px rgba(20, 30, 60, .28),
    0 8px 24px rgba(20, 30, 60, .10);
}
[data-theme="light"] .nxd-stage::before { opacity: .5; }
.nxd-screen[data-appearance="light"] {
  --a-bg:        #f4f4f7;   /* nexusBackground */
  --a-surface:   #fefeff;   /* nexusSurface */
  --a-side:      #eeeef0;
  --a-select:    #e6eefd;   /* nexusSidebarSelection */
  --a-select-bd: #c4d4f6;
  --a-input:     #fcfcff;   /* nexusInputBackground */
  --a-term:      #fafafa;
  --a-panel:     #f1f3f5;
  --a-well:      #f5f5f8;
  --a-chip:      rgba(0, 0, 0, .055);
  --a-btn:       rgba(0, 0, 0, .065);
  --a-border:    rgba(0, 0, 0, .09);    /* nexusBorder */
  --a-hair:      rgba(0, 0, 0, .07);
  --a-text:      #1f1f29;   /* nexusTextPrimary */
  --a-text-2:    #666b7a;   /* nexusTextSecondary */
  --a-text-3:    #9a9eab;
  --a-primary:   #3878e0;   /* nexusPrimary */
  --a-fav:       #e0b838;   /* nexusFavorite */
  --a-green:     #2ea652;   /* nexusSuccess */
  --a-orange:    #d99438;   /* nexusWarning */
  --a-red:       #d14747;   /* nexusError */
  --a-blue:      #4085d9;   /* nexusInfoBlue */
  --a-purple:    #8c61d1;   /* nexusInfoPurple */
  --a-cyan:      #269ec7;   /* nexusInfoCyan */
  --a-teal:      #269e94;   /* nexusInfoTeal */
  --a-indigo:    #616bd1;   /* nexusInfoIndigo */
  --a-disconnect:#f0913f;
  --a-shadow:    0 1px 2px rgba(0, 0, 0, .05), 0 1px 1px rgba(0, 0, 0, .03);
  --a-glass:     #ececee;
  --a-glass-sh:  inset 0 0 0 .5px rgba(0, 0, 0, .24);
  --t-fg:        #26262b;
  --t-dim:       #8a8d96;
  --t-blue:      #2f78b5;
  --t-green:     #3f8f46;
  --t-amber:     #b07d20;
  --t-red:       #c9383a;
  --t-purple:    #9b3aa3;
  --t-caret:     #3b6fe0;
  color-scheme: light;
}
.nxd-screen[data-appearance="dark"] {
  --a-bg:        #242429;
  --a-surface:   #303036;
  --a-side:      #2c2c31;
  --a-select:    #364566;
  --a-select-bd: rgba(115, 160, 230, .28);
  --a-input:     #38383d;
  --a-term:      #1e1e22;
  --a-panel:     #29292e;
  --a-well:      #2a2a2f;
  --a-chip:      rgba(255, 255, 255, .08);
  --a-btn:       rgba(255, 255, 255, .09);
  --a-border:    rgba(255, 255, 255, .12);
  --a-hair:      rgba(255, 255, 255, .08);
  --a-text:      #e0e0e6;
  --a-text-2:    #a6a6b3;
  --a-text-3:    #767682;
  --a-primary:   #4d8cd9;
  --a-fav:       #d9bf73;
  --a-green:     #80b880;
  --a-orange:    #d9ad73;
  --a-red:       #d17a7a;
  --a-blue:      #73a6d9;
  --a-purple:    #b38cd9;
  --a-cyan:      #73bfcc;
  --a-teal:      #73bfb3;
  --a-indigo:    #8c99d9;
  --a-disconnect:#d9853d;
  --a-shadow:    0 0 0 1px rgba(255, 255, 255, .02);
  --a-glass:     #3a3a40;
  --a-glass-sh:  inset 0 0 0 .5px rgba(255, 255, 255, .2);
  --t-fg:        #d9d9de;
  --t-dim:       #85858f;
  --t-blue:      #6fa8dc;
  --t-green:     #7fbf7f;
  --t-amber:     #d6a85a;
  --t-red:       #e07a7a;
  --t-purple:    #c68ad0;
  --t-caret:     #6f9bef;
  --debian:      #d9536f;
  color-scheme: dark;
}

/* ---- Canvas ------------------------------------------------------------ */
.nxd-app {
  position: absolute;
  top: 0; left: 0;
  width: 1200px; height: 772px;
  transform: scale(var(--nxd-scale));
  transform-origin: 0 0;
  display: flex;
  background: var(--a-bg);
  color: var(--a-text);
  font: 400 13px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  transition: background .3s var(--nx-ease), color .3s var(--nx-ease);
}
.nxd-app *, .nxd-app *::before, .nxd-app *::after { box-sizing: border-box; }
.nxd-app h4, .nxd-app h5, .nxd-app p { margin: 0; color: inherit; }
.nxd-app code, .nxd-mono {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
}
.nxd-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Glyphs are the app's SF Symbols exported as filled outlines (13 pt
   regular, centred in a 16-unit box), so they fill rather than stroke. */
.nxd-i {
  display: inline-block;
  width: 16px; height: 16px;
  flex: 0 0 auto;
  fill: currentColor;
  overflow: visible;
  vertical-align: middle;
}
.nxd-sp { flex: 1 1 auto; }
.nxd-sans { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; }
.nxd-accent { color: var(--a-primary); }
.nxd-ok { color: var(--a-green); }
.nxd-red { color: var(--a-red); }
.nxd-blue { color: var(--a-blue); }
.nxd-orange { color: var(--a-orange); }
.nxd-purple { color: var(--a-purple); }
.nxd-teal { color: var(--a-teal); }
.nxd-dim { opacity: .35; }

/* ---- Sidebar ----------------------------------------------------------
   macOS 27: a full-height panel on the window's leading edge, no inset card,
   border or shadow. Geometry measured from the app window on macOS 27. */
.nxd-side {
  position: relative;
  width: 220px;
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  padding: 52px 12px 14px;
  background: var(--a-side);
}
.nxd-traffic {
  position: absolute;
  top: 7.5px; left: 19px; right: 8px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nxd-traffic > i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18); }
.nxd-traffic > i:nth-child(1) { background: #ff5f57; }
.nxd-traffic > i:nth-child(2) { background: #febc2e; }
.nxd-traffic > i:nth-child(3) { background: #28c840; }
.nxd-side-toggle { margin-left: auto; color: var(--a-text-2); }
.nxd-nav { display: flex; flex-direction: column; gap: 2px; }
.nxd-nav-bottom { margin-top: auto; }
.nxd-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--a-text);
  transition: background .22s var(--nx-ease), border-color .22s var(--nx-ease);
}
.nxd-nav-item .nxd-i { width: 17px; height: 17px; color: var(--a-primary); }
.nxd-nav-item.is-active { background: var(--a-select); border-color: var(--a-select-bd); font-weight: 600; }
.nxd-pro {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--a-green) 45%, transparent);
  color: var(--a-green);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}
.nxd-side-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 20px 4px;
  font-size: 11px;
  color: var(--a-text-2);
}
.nxd-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--a-green); transition: background .22s; }
.nxd-status-dot.is-off { background: var(--a-text-3); }
.nxd-side-sep { width: 1px; height: 11px; background: var(--a-border); }

/* ---- Main area + views ------------------------------------------------- */
.nxd-main { position: relative; flex: 1 1 auto; min-width: 0; }
.nxd-view {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--nx-ease), visibility 0s linear .3s;
}
.nxd-view.is-active { opacity: 1; visibility: visible; transition: opacity .3s var(--nx-ease), visibility 0s; }
.nxd-view[data-view="connections"],
.nxd-view[data-view="keys"],
.nxd-view[data-view="containers"],
.nxd-view[data-view="logs"],
.nxd-view[data-view="network"] { flex-direction: column; }

.nxd-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  padding: 0 14px 7px 20px;
}
.nxd-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.nxd-toolbar .nxd-glass + .nxd-title,
.nxd-toolbar .nxd-glass + .nxd-glass { margin-left: 2px; }
.nxd-toolbar .nxd-title:not(:first-child) { margin-left: 12px; }
.nxd-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: 18px;
  background: var(--a-glass);
  box-shadow: var(--a-glass-sh);
  color: var(--a-text);
  transition: transform .14s var(--nx-ease), background .14s;
}
.nxd-glass .nxd-i { width: 17px; height: 17px; }
.nxd-circle { width: 36px; }
.nxd-pillbtn { padding: 0 12px; font-size: 13px; }
.nxd-pillbtn .nxd-chev { width: 11px; height: 11px; margin-left: -2px; }
.nxd-seg { gap: 16px; padding: 0 12px; }
.nxd-seg-icons { gap: 18px; padding: 0 13px; }

/* Shared: cards, tiles, pills, buttons, chips */
.nxd-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 14px;
  box-shadow: var(--a-shadow);
}
.nxd-card-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--a-text-2); }
.nxd-card-head .nxd-i { width: 16px; height: 16px; }
.nxd-card-head-lg { font-size: 14px; color: var(--a-text); }
.nxd-caps { font-size: 11.5px; letter-spacing: .06em; color: var(--a-text-2); }
.nxd-caps small { font-size: 11.5px; letter-spacing: 0; font-weight: 400; }
.nxd-tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
}
.nxd-tile .nxd-i { width: 16px; height: 16px; }
.nxd-tile-lg { width: 36px; height: 36px; border-radius: 9px; }
.nxd-tile-lg .nxd-i { width: 19px; height: 19px; }
.nxd-tile-xl { width: 56px; height: 56px; border-radius: 13px; }
.nxd-tile-xl .nxd-i { width: 26px; height: 26px; }
.nxd-t-green  { color: var(--a-green);  background: color-mix(in srgb, var(--a-green) 12%, transparent); }
.nxd-t-blue   { color: var(--a-blue);   background: color-mix(in srgb, var(--a-blue) 12%, transparent); }
.nxd-t-indigo { color: var(--a-indigo); background: color-mix(in srgb, var(--a-indigo) 12%, transparent); }
.nxd-t-teal   { color: var(--a-teal);   background: color-mix(in srgb, var(--a-teal) 12%, transparent); }
.nxd-t-orange { color: var(--a-orange); background: color-mix(in srgb, var(--a-orange) 13%, transparent); }
.nxd-t-purple { color: var(--a-purple); background: color-mix(in srgb, var(--a-purple) 12%, transparent); }
.nxd-t-cyan   { color: var(--a-cyan);   background: color-mix(in srgb, var(--a-cyan) 12%, transparent); }

.nxd-status-pill {
  --c: var(--a-text-2);
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 500;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  transition: color .22s, background .22s, border-color .22s;
}
.nxd-status-pill > i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nxd-status-pill.is-ok   { --c: var(--a-green); }
.nxd-status-pill.is-calm { --c: var(--a-green); }
.nxd-status-pill.is-warn { --c: var(--a-orange); }
.nxd-status-pill.is-busy { --c: var(--a-orange); }
.nxd-status-pill.is-run  { --c: var(--a-primary); }
.nxd-status-pill.is-busy > i,
.nxd-status-pill.is-run > i { animation: nxd-pulse 1s ease-in-out infinite; }
@keyframes nxd-pulse { 50% { opacity: .25; } }

.nxd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 25px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--a-text);
  background: var(--a-btn);
  white-space: nowrap;
  transition: background .22s var(--nx-ease), color .22s, transform .14s var(--nx-ease), filter .14s;
}
.nxd-btn .nxd-i { width: 14px; height: 14px; }
.nxd-btn-orange { background: var(--a-disconnect); color: #fff; }
.nxd-btn-blue { background: var(--a-primary); color: #fff; }
.nxd-btn-warn { background: var(--a-orange); color: #fff; }
.is-pressed { transform: scale(.94); filter: brightness(.9); }

.nxd-bar {
  position: relative;
  display: inline-block;
  width: 78px; height: 4px;
  border-radius: 2px;
  background: var(--a-chip);
  overflow: hidden;
  vertical-align: middle;
}
.nxd-bar > i {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 2px;
  background: var(--a-green);
  transition: width .6s var(--nx-ease);
}
.nxd-bar-wide { width: 104px; }
.nxd-bar-wide > i { background: var(--a-cyan); }
.nxd-bar-sm { width: 30px; height: 3px; }
.nxd-bar-sm > i { background: var(--a-primary); }

.nxd-search {
  display: flex; align-items: center; gap: 10px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  background: var(--a-input);
  border: 1px solid var(--a-border);
  color: var(--a-text-3);
  font-size: 13px;
}
.nxd-search .nxd-i { color: var(--a-text-2); width: 15px; height: 15px; }
.nxd-search em { font-style: normal; }
.nxd-search.is-focus { border-color: color-mix(in srgb, var(--a-primary) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-primary) 18%, transparent); }
.nxd-search .nxd-q { color: var(--a-text); }

.nxd-segctl {
  display: inline-flex;
  padding: 2px;
  border-radius: 7px;
  background: var(--a-chip);
  font-size: 12px;
}
.nxd-segctl > b {
  padding: 3px 11px;
  border-radius: 5px;
  font-weight: 500;
  color: var(--a-text);
  transition: background .22s, color .22s, box-shadow .22s;
}
.nxd-segctl > b.is-on { background: var(--a-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.nxd-segctl-blue > b.is-on { background: var(--a-primary); color: #fff; }
.nxd-segctl-round { border-radius: 15px; padding: 3px; background: transparent; border: 1px solid var(--a-border); }
.nxd-segctl-round > b { border-radius: 12px; padding: 3px 10px; letter-spacing: 0; font-weight: 500; }
.nxd-segctl-round > b.is-on { background: var(--a-primary); color: #fff; box-shadow: none; }

.nxd-sq {
  display: inline-flex; align-items: center; justify-content: center;
  width: 25px; height: 25px;
  border-radius: 6px;
  background: var(--a-btn);
  color: var(--a-text-2);
  transition: transform .14s var(--nx-ease), filter .14s;
}
.nxd-sq .nxd-i { width: 13px; height: 13px; }
.nxd-sq-blue   { color: var(--a-blue);   background: color-mix(in srgb, var(--a-blue) 14%, transparent); }
.nxd-sq-red    { color: var(--a-red);    background: color-mix(in srgb, var(--a-red) 14%, transparent); }
.nxd-sq-green  { color: var(--a-green);  background: color-mix(in srgb, var(--a-green) 15%, transparent); }
.nxd-sq-orange { color: var(--a-orange); background: color-mix(in srgb, var(--a-orange) 16%, transparent); }

/* ---- Connections ------------------------------------------------------- */
.nxd-conn { flex: 1; display: flex; gap: 16px; min-height: 0; padding: 0 14px 0 19px; }
.nxd-conn-list { width: 313px; flex: 0 0 313px; display: flex; flex-direction: column; gap: 10px; padding-top: 9px; overflow: hidden; }
.nxd-group {
  display: flex; align-items: center; gap: 7px;
  margin: 12px 0 -2px 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--a-text-2);
}
.nxd-group .nxd-i { width: 14px; height: 14px; color: var(--a-primary); }
.nxd-fav { color: var(--a-fav) !important; }
.nxd-group .nxd-fav { width: 15px; height: 15px; }
.nxd-host {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  box-shadow: var(--a-shadow);
  transition: background .22s, border-color .22s;
}
.nxd-host.is-selected { background: var(--a-select); border-color: var(--a-select-bd); }
/* ServerCardIconView: 24 pt OS artwork on a 36 pt tile, radius 10, filled
   with a secondary-colour gradient. */
.nxd-os {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--a-text-2) 18%, transparent), color-mix(in srgb, var(--a-text-2) 8%, transparent));
  color: var(--a-text);
}
.nxd-os .nxd-i { width: 24px; height: 24px; }
.nxd-os-dot {
  position: absolute; right: -3px; bottom: -3px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #a1a1a8;
  border: 2px solid var(--a-surface);
  transition: background .22s;
}
.nxd-host.is-selected .nxd-os-dot { border-color: var(--a-select); }
.nxd-os-dot.is-on { background: var(--a-green); }
.nxd-os-dot.is-busy { background: var(--a-orange); animation: nxd-pulse 1s ease-in-out infinite; }
.nxd-os-lg { width: 56px; height: 56px; border-radius: 15.5px; }
.nxd-os-lg .nxd-i { width: 32px; height: 32px; }
.nxd-host-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nxd-host-meta b { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700; }
.nxd-host-meta b .nxd-i { width: 12px; height: 12px; }
.nxd-host-meta code { font-size: 11.5px; color: var(--a-text-2); }
.nxd-tags { display: flex; gap: 5px; margin-top: 5px; }
.nxd-tags > i {
  font-style: normal;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 9px;
  background: var(--a-chip);
  color: var(--a-text);
}
.nxd-tags > .nxd-flag {
  width: 24px;
  background: var(--a-chip) radial-gradient(circle at 50% 50%, #d62b3b 0 3px, #fff 3.5px) center / 13px 9px no-repeat;
}

.nxd-conn-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding-top: 9px; overflow: hidden; }
.nxd-conn-head { padding: 16px 16px 16px; }
.nxd-conn-id { display: flex; align-items: flex-start; gap: 14px; }
.nxd-conn-id h5 { display: flex; align-items: center; gap: 8px; margin: 2px 0 3px; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.nxd-conn-id h5 .nxd-i { width: 17px; height: 17px; }
.nxd-conn-id code { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--a-text-2); }
.nxd-conn-id code .nxd-i { width: 13px; height: 13px; }
.nxd-keytint { color: var(--a-green); }
.nxd-sep { width: 1px; height: 12px; background: var(--a-border); margin: 0 3px; }
.nxd-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.nxd-monitor { position: relative; padding: 16px 16px 14px; }
.nxd-live { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--a-green); transition: opacity .22s; }
.nxd-live > i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.nxd-metrics, .nxd-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-top: 14px; }
.nxd-span2 { grid-column: 1 / -1; }
.nxd-metric { display: flex; align-items: flex-start; gap: 11px; }
.nxd-metric > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nxd-metric small { font-size: 11px; color: var(--a-text-2); }
.nxd-metric small em { font-style: normal; font-size: 9.5px; color: var(--a-text-3); margin-left: 3px; }
.nxd-metric b { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; font-weight: 600; }
.nxd-metric b.nxd-sans { font-family: inherit; }
.nxd-barline { display: flex; align-items: center; gap: 10px; }
.nxd-barline > span { font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 13px; font-weight: 600; }
.nxd-sub { font-style: normal; font-size: 10.5px; color: var(--a-text-2); }
.nxd-netio { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px !important; }
.nxd-netio .nxd-dn, .nxd-cnet .nxd-dn { color: var(--a-green); }
.nxd-netio .nxd-up, .nxd-cnet .nxd-up { color: var(--a-orange); }
.nxd-netio > span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.nxd-netio .nxd-i, .nxd-cnet .nxd-i { width: 10px; height: 10px; }
.nxd-monitor-empty {
  position: absolute; inset: 44px 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--a-text-2);
  opacity: 0;
  transition: opacity .22s;
}
.nxd-monitor.is-off .nxd-metrics { opacity: .18; filter: grayscale(1); }
.nxd-monitor.is-off .nxd-live { opacity: 0; }
.nxd-monitor.is-loading .nxd-metrics { opacity: 0; }
.nxd-monitor.is-loading .nxd-monitor-empty { opacity: 1; }
.nxd-monitor .nxd-metrics { transition: opacity .3s, filter .3s; }
.nxd-specs { margin-top: 14px; padding: 0; }
.nxd-conn-detail > .nxd-card:nth-child(3) { padding: 16px; }
.nxd-conn-detail > .nxd-card:nth-child(4) { padding: 16px 16px 6px; }
.nxd-history { display: flex; flex-direction: column; margin-top: 8px; }
.nxd-hrow {
  display: flex; align-items: center; gap: 10px;
  height: 30px;
  font-size: 12px;
  color: var(--a-text-2);
}
.nxd-hrow + .nxd-hrow { border-top: 1px solid var(--a-hair); }
.nxd-hrow > i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-green); margin-left: 2px; }
.nxd-hrow b { font-size: 10.5px; font-weight: 600; color: var(--a-green); background: color-mix(in srgb, var(--a-green) 13%, transparent); padding: 2px 8px; border-radius: 5px; }
.nxd-hrow .nxd-i { width: 11px; height: 11px; color: var(--a-text-3); }
.nxd-hrow.is-new { animation: nxd-rowin .35s var(--nx-ease); }
@keyframes nxd-rowin { from { opacity: 0; transform: translateY(-6px); } }

/* ---- Terminal ---------------------------------------------------------- */
.nxd-term-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nxd-ttabs {
  display: flex; align-items: center; gap: 10px;
  height: 40px;
  padding: 0 16px 0 10px;
  border-bottom: 1px solid var(--a-hair);
}
.nxd-ttab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 10px 0 11px;
  border-radius: 8px;
  background: var(--a-select);
  border: 1px solid var(--a-select-bd);
  font-size: 12.5px;
  font-weight: 600;
}
.nxd-ttab > i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-green); }
.nxd-ttab .nxd-i { width: 11px; height: 11px; color: var(--a-text-2); margin-left: 4px; }
.nxd-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--a-text-3); }
.nxd-hint kbd { font: inherit; padding: 1px 4px; border-radius: 4px; background: var(--a-chip); color: var(--a-text-3); }
.nxd-hint-kb { color: var(--a-text-3); width: 17px; height: 17px; }
.nxd-term {
  flex: 1;
  min-height: 0;
  padding: 12px 14px;
  background: var(--a-term);
  color: var(--t-fg);
  font: 400 12.5px/15px "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: hidden;
}
.nxd-term > div { min-height: 15px; }
.nxd-term .d { color: var(--t-dim); }
.nxd-term .b { color: var(--t-blue); font-weight: 700; }
.nxd-term .g { color: var(--t-green); }
.nxd-term .a { color: var(--t-amber); font-weight: 700; }
.nxd-term .r { color: var(--t-red); }
.nxd-term .p { color: var(--t-purple); }
.nxd-term .w { font-weight: 700; }
.nxd-caret {
  display: inline-block;
  width: 7.5px; height: 14px;
  margin-bottom: -2px;
  background: var(--t-caret);
  animation: nxd-caret 1.05s steps(2, end) infinite;
}
@keyframes nxd-caret { 50% { opacity: 0; } }

.nxd-ai {
  position: relative;
  width: 0;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--a-panel);
  border-left: 1px solid transparent;
  display: flex;
  flex-direction: column;
  transition: width .3s var(--nx-ease), border-color .3s;
}
.nxd-ai.is-open { width: 361px; border-left-color: var(--a-border); }
.nxd-ai > * { width: 360px; flex: 0 0 auto; }
.nxd-ai-tabs {
  display: flex; align-items: center; gap: 18px;
  margin-top: 60px;
  padding: 0 16px 0 14px;
  height: 30px;
  color: var(--a-text-2);
}
.nxd-ai-tabs .nxd-i { width: 16px; height: 16px; }
.nxd-ai-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 25px;
  padding: 0 11px 0 10px;
  margin-right: -4px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--a-primary) 14%, transparent);
  color: var(--a-primary);
  font-size: 12.5px;
  font-weight: 600;
}
.nxd-ai-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 14px 10px 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--a-text);
}
.nxd-ai-empty {
  margin: auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  color: var(--a-text-2);
  padding: 0 30px 40px;
  font-size: 12px;
}
.nxd-ai-empty .nxd-i { width: 30px; height: 30px; color: color-mix(in srgb, var(--a-text-2) 40%, transparent); }
.nxd-ai-empty b { color: var(--a-text); font-size: 13.5px; }
.nxd-ai-user {
  align-self: flex-end;
  padding: 6px 13px;
  border-radius: 13px;
  background: #3f78dd;
  color: #fff;
  font-size: 13px;
}
.nxd-ai-body h6 { margin: 4px 0 -2px; font-size: 13.5px; font-weight: 700; color: var(--a-text); }
.nxd-ai-body p { margin: 0; }
.nxd-ai-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.nxd-ai-body code { font-size: 11.5px; color: #2f9e74; }
.nxd-ai-body strong code { font-weight: 700; }
.nxd-screen[data-appearance="dark"] .nxd-ai-body code { color: #7fcfa9; }
.nxd-ai-code {
  border-radius: 9px;
  border: 1px solid var(--a-border);
  background: var(--a-well);
  overflow: hidden;
}
.nxd-ai-code header {
  display: flex; align-items: center;
  padding: 6px 10px;
  font-size: 10.5px;
  color: var(--a-text-2);
  border-bottom: 1px solid var(--a-hair);
}
.nxd-ai-code header span { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; transition: color .2s; }
.nxd-ai-code header span.is-done { color: var(--a-green); }
.nxd-ai-code header .nxd-i { width: 11px; height: 11px; }
.nxd-ai-code pre {
  margin: 0;
  padding: 8px 10px 9px;
  font: 400 11.5px/1.5 "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--a-text);
  white-space: pre-wrap;
}
.nxd-ai-code pre .pr { color: #d4663d; }
.nxd-ai-code pre .o { color: var(--a-blue); }
.nxd-ai-actions { display: flex; gap: 6px; padding: 4px 14px 8px; }
.nxd-chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--a-btn);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform .14s var(--nx-ease), filter .14s;
}
.nxd-chip-btn .nxd-i { width: 13px; height: 13px; }
.nxd-ai-input {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 14px;
}
.nxd-ai-input > span {
  flex: 1;
  height: 36px;
  display: flex; align-items: center;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--a-btn);
  color: var(--a-text-3);
  font-size: 13px;
}
.nxd-send {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  color: var(--a-text-2);
}
.nxd-send .nxd-i { width: 26px; height: 26px; }
.nxd-ai-toggle { position: absolute; top: 9px; right: 14px; color: var(--a-purple); }
.nxd-ai-toggle .nxd-i { width: 20px; height: 20px; }
.nxd-ai-body > * { animation: nxd-rowin .3s var(--nx-ease) both; }

/* ---- Files ------------------------------------------------------------- */
.nxd-files-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nxd-files-col .nxd-toolbar { padding-left: 6px; }
.nxd-panes { flex: 1; min-height: 0; display: flex; }
.nxd-fpane { display: flex; flex-direction: column; min-width: 0; position: relative; }
.nxd-fpane-local {
  width: 0;
  overflow: hidden;
  border-right: 1px solid transparent;
  transition: width .3s var(--nx-ease), border-color .3s;
}
.nxd-panes.is-split .nxd-fpane-local { width: 252px; border-right-color: var(--a-border); }
.nxd-fpane-local > * { width: 252px; }
.nxd-fpane-remote { flex: 1; min-width: 0; overflow: hidden; }
.nxd-panes.is-split .nxd-fhead-4,
.nxd-panes.is-split .nxd-frow-4 { grid-template-columns: 1fr 76px 112px; }
.nxd-panes.is-split .nxd-fhead-4 > :nth-child(3),
.nxd-panes.is-split .nxd-frow-4 > :nth-child(3) { display: none; }
.nxd-crumbs {
  display: flex; align-items: center; gap: 7px;
  height: 36px;
  padding: 0 16px 0 12px;
  font: 400 12.5px "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--a-text-2);
  white-space: nowrap;
}
.nxd-crumbs > .nxd-i:first-child { width: 15px; height: 15px; }
.nxd-crumbs .nxd-i { width: 10px; height: 10px; color: var(--a-text-3); }
.nxd-crumbs > .nxd-i:first-child, .nxd-crumbs > .nxd-sp + .nxd-i { width: 15px; height: 15px; color: var(--a-text-2); }
.nxd-crumb-cur { color: var(--a-text); }
.nxd-fhead, .nxd-frow {
  display: grid;
  grid-template-columns: 1fr 84px;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 12px;
}
.nxd-fhead-4, .nxd-frow-4 { grid-template-columns: 1fr 90px 130px 124px; }
.nxd-fpane-local .nxd-fhead, .nxd-fpane-local .nxd-frow { grid-template-columns: 1fr 62px; gap: 8px; }
.nxd-fhead {
  height: 26px;
  font-size: 10.5px;
  color: var(--a-text-2);
  border-bottom: 1px solid var(--a-hair);
}
.nxd-fhead > span:nth-child(2) { text-align: right; }
.nxd-fhead-4 > span:nth-child(3) { text-align: center; }
.nxd-fhead-4 > span:nth-child(4) { text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.nxd-fhead-4 .nxd-i { width: 10px; height: 10px; }
.nxd-frows { flex: 1; min-height: 0; overflow: hidden; }
.nxd-frow {
  height: 37px;
  border-bottom: 1px solid var(--a-hair);
  font-size: 13px;
  transition: background .15s;
}
.nxd-frow > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nxd-frow > span:nth-child(2) { text-align: right; font: 400 12px "SF Mono", ui-monospace, Menlo, monospace; color: var(--a-text-2); }
.nxd-frow-4 > span:nth-child(3) { text-align: center; font: 400 11px "SF Mono", ui-monospace, Menlo, monospace; color: var(--a-text-2); }
.nxd-frow-4 > span:nth-child(4) { text-align: right; font-size: 11px; color: var(--a-text-2); }
.nxd-frow .nxd-i { width: 19px; height: 19px; }
/* Tints from FilesView.iconForExtension. */
.nxd-fc-folder { color: color-mix(in srgb, var(--a-blue) 70%, transparent); }
.nxd-fc-blue { color: var(--a-blue); }
.nxd-fc-indigo { color: var(--a-indigo); }
.nxd-fc-purple { color: var(--a-purple); }
.nxd-fc-green { color: var(--a-green); }
.nxd-fc-red { color: var(--a-red); }
.nxd-fc-yellow { color: var(--a-fav); }
.nxd-fc-gray { color: var(--a-text-2); }
.nxd-frow.is-selected { background: var(--a-primary); color: #fff; }
.nxd-frow.is-selected > span { color: #fff !important; }
.nxd-frow.is-selected .nxd-i { color: #fff; }
.nxd-frow.is-new { background: color-mix(in srgb, var(--a-primary) 12%, transparent); animation: nxd-rowin .35s var(--nx-ease); }
.nxd-frow.is-ghost { opacity: .45; }
.nxd-drop {
  position: absolute;
  inset: 40px 10px 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px;
  border: 2px dashed color-mix(in srgb, var(--a-primary) 70%, transparent);
  background: color-mix(in srgb, var(--a-primary) 8%, transparent);
  color: var(--a-primary);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
}
.nxd-drop .nxd-i { width: 18px; height: 18px; }
.nxd-drop.is-on { opacity: 1; }
.nxd-tx {
  width: 290px;
  flex: 0 0 290px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--a-border);
  background: var(--a-bg);
}
.nxd-toolbar-end { justify-content: flex-end; }
.nxd-tx-list { padding: 0 14px 0 12px; }
.nxd-tx-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0 11px;
  border-bottom: 1px solid var(--a-hair);
}
.nxd-tx-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nxd-tx-row b { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nxd-tx-row small { font-size: 10.5px; color: var(--a-text-2); }
.nxd-tx-icn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  color: var(--a-green);
  flex: 0 0 auto;
}
.nxd-tx-icn .nxd-i { width: 20px; height: 20px; }
.nxd-tx-dn { color: var(--a-blue); }
.nxd-tx-done {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  color: var(--a-green);
  flex: 0 0 auto;
}
.nxd-tx-done .nxd-i { width: 17px; height: 17px; }
.nxd-tx-bar { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--a-chip); overflow: hidden; }
.nxd-tx-bar > i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--a-primary); }
.nxd-tx-row.is-new { animation: nxd-rowin .35s var(--nx-ease); }
.nxd-tx-row .nxd-tx-done { transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.nxd-tx-row.is-done .nxd-tx-done, .nxd-tx-row:not(.is-live) .nxd-tx-done { transform: scale(1); }

/* ---- Keys -------------------------------------------------------------- */
.nxd-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px 14px;
  padding: 9px 14px 0 19px;
  align-content: start;
}
.nxd-kcard {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  box-shadow: var(--a-shadow);
  overflow: hidden;
}
.nxd-kcard-top { display: flex; align-items: flex-start; gap: 11px; padding: 12px 12px 10px; }
.nxd-kcard-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nxd-kcard-top b { font-size: 13.5px; font-weight: 700; }
.nxd-kcard-top small { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--a-text-2); }
.nxd-kcard-top small .nxd-i { width: 11px; height: 11px; }
.nxd-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--a-blue);
  background: color-mix(in srgb, var(--a-blue) 13%, transparent);
}
.nxd-badge-purple { color: var(--a-purple); background: color-mix(in srgb, var(--a-purple) 13%, transparent); }
.nxd-kfp {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--a-hair);
  font-size: 11.5px;
  color: var(--a-text-3);
}
.nxd-kfp code { flex: 1; color: var(--a-text); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nxd-kfp .nxd-i { width: 13px; height: 13px; color: var(--a-text-2); }
.nxd-kfp .nxd-kfp-num { width: 11px; height: 11px; color: var(--a-text-3); }
.nxd-kcard footer {
  display: flex; align-items: center; gap: 6px;
  margin-top: auto;
  padding: 8px 12px;
  background: var(--a-well);
  border-top: 1px solid var(--a-hair);
}
.nxd-src {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 9px;
  background: var(--a-chip);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--a-text-2);
}
.nxd-src .nxd-i { width: 11px; height: 11px; }
.nxd-kcard.is-new { animation: nxd-cardin .4s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes nxd-cardin { from { opacity: 0; transform: scale(.94); } }
.nxd-kcard.is-new { border-color: color-mix(in srgb, var(--a-primary) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-primary) 14%, transparent); transition: border-color 1s, box-shadow 1s; }
.nxd-kcard.is-new.is-settled { border-color: var(--a-border); box-shadow: var(--a-shadow); }
.nxd-scramble { color: var(--a-primary) !important; }

.nxd-sheet-wrap {
  position: absolute; inset: 0;
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 58px;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background .3s;
}
.nxd-sheet-wrap.is-open { background: rgba(0, 0, 0, .12); }
.nxd-sheet {
  width: 440px;
  padding: 20px 22px 18px;
  border-radius: 14px;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25), 0 4px 12px rgba(0, 0, 0, .1);
  opacity: 0;
  transform: translateY(-16px) scale(.98);
  transition: opacity .3s var(--nx-ease), transform .3s var(--nx-ease);
}
.nxd-sheet-wrap.is-open .nxd-sheet { opacity: 1; transform: none; }
.nxd-sheet h5 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.nxd-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12px; font-weight: 600; color: var(--a-text-2); }
.nxd-input {
  display: flex; align-items: center;
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--a-border);
  background: var(--a-input);
  font-size: 13px;
  font-weight: 400;
  color: var(--a-text);
}
.nxd-input em { font-style: normal; color: var(--a-text-3); }
.nxd-input.is-focus { border-color: color-mix(in srgb, var(--a-primary) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-primary) 20%, transparent); }
.nxd-field .nxd-segctl { align-self: flex-start; font-weight: 400; }
.nxd-sheet-info { display: flex; gap: 8px; font-size: 11.5px; line-height: 1.5; color: var(--a-text-2); }
.nxd-sheet-info .nxd-i { width: 14px; height: 14px; margin-top: 1px; color: var(--a-blue); }
.nxd-sheet-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.nxd-sheet-btns .nxd-btn { height: 26px; padding: 0 14px; }
.nxd-toast {
  position: absolute; left: 50%; bottom: 26px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 20px;
  background: var(--a-glass);
  box-shadow: var(--a-glass-sh);
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .3s, transform .3s var(--nx-ease);
}
.nxd-toast .nxd-i { width: 14px; height: 14px; color: var(--a-green); }
.nxd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---- Containers -------------------------------------------------------- */
.nxd-cont-srv {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 21px;
  font-size: 11.5px;
  color: var(--a-text-2);
}
.nxd-cont-srv .nxd-i { width: 16px; height: 16px; }
.nxd-cont-srv b { font-size: 13px; font-weight: 700; color: var(--a-text); }
.nxd-conts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 14px 0 19px; align-items: start; }
.nxd-cont-body { flex: 1; min-height: 0; overflow: hidden; }
.nxd-pillbtn-label { gap: 7px; }
.nxd-pillbtn-label .nxd-i { width: 15px; height: 15px; }
/* composeProjectHeader: icon, name, status dot, counts, then the mini
   buttons right after the content (not pushed to the row's end). */
.nxd-proj {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 16px 8px 23px;
  font-size: 11px; color: var(--a-text-2);
}
.nxd-proj .nxd-proj-icn { width: 13px; height: 13px; color: color-mix(in srgb, var(--a-primary) 85%, transparent); }
.nxd-proj b { font-size: 12.5px; font-weight: 600; color: var(--a-text); }
.nxd-proj-dot { width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--a-text-2) 50%, transparent); transition: background .25s; }
.nxd-proj.is-up .nxd-proj-dot { background: var(--a-green); }
.nxd-proj.is-busy .nxd-proj-dot { background: var(--a-orange); animation: nxd-pulse 1s ease-in-out infinite; }
.nxd-proj-btns { display: inline-flex; gap: 4px; margin-left: 8px; }
.nxd-proj-btns .nxd-sq { width: 22px; height: 22px; }
.nxd-proj-btns .nxd-sq .nxd-i { width: 11px; height: 11px; }
.nxd-proj.is-up .nxd-when-down, .nxd-proj:not(.is-up) .nxd-when-up { display: none; }
.nxd-cont-group { padding: 16px 16px 8px 23px; font-size: 11px; font-weight: 600; color: var(--a-text-2); }

/* ComposeTemplatesSheet (750 × 550 in the app). */
.nxd-csheet { width: 750px; height: 540px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.nxd-csheet-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--a-hair); }
.nxd-csheet-head .nxd-i { width: 16px; height: 16px; color: var(--a-primary); }
.nxd-csheet-head b { font-size: 13.5px; font-weight: 700; }
.nxd-csheet-head .nxd-btn { height: 24px; padding: 0 12px; }
.nxd-csheet-body { flex: 1; min-height: 0; display: flex; }
.nxd-csheet-list { width: 220px; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px 0; border-right: 1px solid var(--a-hair); background: var(--a-panel); }
.nxd-csheet-list .nxd-search { margin: 0 2px 8px; height: 28px; font-size: 12px; }
.nxd-ctpl { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 7px; }
.nxd-ctpl b { font-size: 12.5px; font-weight: 500; color: var(--a-text); }
.nxd-ctpl small { font-size: 10.5px; color: var(--a-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nxd-ctpl.is-selected { background: var(--a-primary); }
.nxd-ctpl.is-selected b, .nxd-ctpl.is-selected small { color: #fff; }
.nxd-ctpl.is-selected small { opacity: .8; }
.nxd-csheet-tools { display: flex; margin: auto -8px 0; padding: 4px 8px; border-top: 1px solid var(--a-hair); }
.nxd-csheet-tools i { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 20px; color: var(--a-text-2); }
.nxd-csheet-tools .nxd-i { width: 11px; height: 11px; }
.nxd-csheet-edit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 14px; }
.nxd-csheet-edit .nxd-input { font-size: 13px; }
.nxd-yaml {
  flex: 1; min-height: 0; margin: 0; overflow: hidden;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--a-border);
  background: var(--a-term);
  font: 400 11.5px/1.55 "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--a-text);
}
.nxd-yaml .k { color: var(--t-blue); }
.nxd-yaml .s { color: var(--t-green); }
.nxd-csheet-foot { display: flex; align-items: center; gap: 8px; }
.nxd-csheet-foot small { font-size: 11px; color: var(--a-text-2); }
.nxd-csheet-foot .nxd-btn { height: 26px; padding: 0 14px; }
.nxd-ccard {
  --c: var(--a-green);
  display: flex; flex-direction: column;
  border-radius: 12px;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  box-shadow: var(--a-shadow);
  overflow: hidden;
  min-height: 196px;
}
.nxd-ccard.is-exited { --c: var(--a-red); }
.nxd-ccard.is-starting { --c: var(--a-orange); }
.nxd-ccard-top { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px 10px; border-bottom: 1px solid var(--a-hair); }
.nxd-ccard-top > div { display: flex; flex-direction: column; gap: 3px; }
.nxd-ccard-top b { font-size: 13.5px; font-weight: 700; }
.nxd-ccard-top small { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--a-text-2); margin-top: 2px; white-space: nowrap; }
.nxd-ccard-top small .nxd-i { width: 11px; height: 11px; }
.nxd-ctile { color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); transition: color .22s, background .22s; }
.nxd-cstate {
  display: inline-flex; align-items: center; gap: 5px;
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  transition: color .22s, background .22s;
}
.nxd-cstate > i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.nxd-ccard.is-starting .nxd-cstate > i { animation: nxd-pulse 1s ease-in-out infinite; }
.nxd-cchips { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 9px 12px 10px; }
.nxd-cchip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 7px;
  font: 400 11px "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--a-text);
  background: color-mix(in srgb, var(--a-blue) 10%, transparent);
}
.nxd-cchip .nxd-i { width: 11px; height: 11px; color: var(--a-blue); }
.nxd-cstats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 12px 9px; border-top: 1px solid var(--a-hair); font-size: 10px; color: var(--a-text-2); min-height: 0; }
.nxd-cstats:empty { border-top: 0; padding: 0; }
.nxd-cstats > span { display: inline-flex; align-items: center; gap: 4px; letter-spacing: .02em; }
.nxd-cstats > span > i:first-child { width: 4px; height: 4px; border-radius: 50%; background: var(--a-text-2); }
.nxd-cstats b { font: 400 10.5px "SF Mono", ui-monospace, Menlo, monospace; color: var(--a-text); }
.nxd-cnet { flex-basis: 100%; }
.nxd-cnet em { font-style: normal; }
.nxd-ccard footer .nxd-sq { width: 22px; height: 22px; }
.nxd-ccard footer { display: flex; align-items: center; gap: 5px; margin-top: auto; padding: 8px 12px; background: var(--a-well); border-top: 1px solid var(--a-hair); }
.nxd-cid .nxd-i { width: 9px; height: 9px; color: var(--a-text-3); }
.nxd-cid { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font: 400 10.5px "SF Mono", ui-monospace, Menlo, monospace; color: var(--a-text-2); padding: 2px 7px; border-radius: 8px; background: var(--a-chip); }
.nxd-ccard.is-exited .nxd-when-run,
.nxd-ccard.is-starting .nxd-when-run,
.nxd-ccard.is-running .nxd-when-exit,
.nxd-ccard.is-starting .nxd-when-exit { display: none; }
.nxd-ccard.is-exited .nxd-cstats { display: none; }
.nxd-ccard.is-fresh .nxd-cstats, .nxd-ccard.is-fresh .nxd-when-run { animation: nxd-rowin .35s var(--nx-ease); }

/* ---- Logs -------------------------------------------------------------- */
.nxd-logs { flex: 1; min-height: 0; display: flex; margin-top: -1px; }
.nxd-logs-list { width: 320px; flex: 0 0 320px; display: flex; flex-direction: column; padding: 9px 12px 0 10px; }
.nxd-search-count { margin-left: auto; font-size: 11px; color: var(--a-text-2); }
.nxd-lrows { flex: 1; min-height: 0; overflow: hidden; margin-top: 8px; }
.nxd-ldate { padding: 12px 8px 5px; font-size: 11.5px; font-weight: 700; color: var(--a-text-2); }
.nxd-lrow { display: flex; flex-direction: column; gap: 3px; padding: 7px 10px; border-radius: 9px; transition: background .2s, opacity .25s; }
.nxd-lrow b { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nxd-lrow small { display: flex; align-items: center; gap: 5px; padding-left: 0; font-size: 11px; color: var(--a-text-2); white-space: nowrap; }
.nxd-lrow small i { font-style: normal; }
.nxd-lrow small i:empty { width: 8px; }
.nxd-lrow::before { content: none; }
.nxd-lrow.is-selected { background: var(--a-select); }
.nxd-lrow:not(.is-selected):not([data-log="rec"]) b::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--a-text-3); flex: 0 0 auto;
}
.nxd-lrow:not(.is-selected):not([data-log="rec"]) small { padding-left: 13px; }
.nxd-lrow.is-selected:not([data-log="rec"]) b::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--a-primary); flex: 0 0 auto;
}
.nxd-lrow.is-selected:not([data-log="rec"]) small { padding-left: 13px; }
.nxd-rec-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--a-green); flex: 0 0 auto; }
.nxd-lrow[data-log="rec"] small { padding-left: 13px; }
.nxd-rec { font-style: normal; font-size: 10px; font-weight: 600; color: var(--a-green); }
.nxd-agent { font-style: normal; font-size: 10px; font-weight: 600; color: var(--a-purple); padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--a-purple) 13%, transparent); }
.nxd-logs-head .nxd-rec { padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--a-green) 13%, transparent); margin-left: 6px; }
.nxd-lrows.is-filtered .nxd-lrow:not([data-match]),
.nxd-lrows.is-filtered .nxd-ldate { display: none; }
.nxd-lrows.is-filtered .nxd-ldate.is-keep { display: block; }
.nxd-lrow mark { background: color-mix(in srgb, var(--a-fav) 45%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.nxd-logs-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-top: -58px; background: var(--a-term); border-left: 1px solid var(--a-border); }
.nxd-logs-head {
  display: flex; align-items: center; gap: 10px;
  height: 58px;
  padding: 0 14px 0 14px;
  background: var(--a-term);
  border-bottom: 1px solid var(--a-hair);
}
.nxd-logs-head > div { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.nxd-logs-head b { display: flex; align-items: center; font-size: 14px; font-weight: 700; }
.nxd-logs-head small { font-size: 11px; color: var(--a-text-2); }
.nxd-logs-head small i { font-style: normal; margin: 0 4px; }
.nxd-logs-head .nxd-segctl { margin-top: 8px; }
.nxd-logs-head .nxd-sq { margin-top: 8px; }
.nxd-view[data-view="logs"] .nxd-toolbar { width: 330px; }
.nxd-log-term { padding-top: 10px; }
.nxd-replay {
  display: none;
  align-items: center; gap: 12px;
  height: 42px;
  padding: 0 16px;
  border-top: 1px solid var(--a-hair);
  background: var(--a-term);
  font-size: 11px;
  color: var(--a-text-2);
}
.nxd-replay.is-on { display: flex; animation: nxd-rowin .3s var(--nx-ease); }
.nxd-replay > .nxd-i { width: 14px; height: 14px; color: var(--a-text); }
.nxd-replay code { font-size: 11px; }
.nxd-scrub { position: relative; flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--a-text-3) 45%, transparent); }
.nxd-scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--a-primary); }
.nxd-scrub-knob { position: absolute; top: -3.5px; left: 0; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: var(--a-primary); }
.nxd-mark { position: absolute; top: -1px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--a-green); }
.nxd-mark-orange { background: var(--a-orange); }
.nxd-menu { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 8px; border-radius: 5px; background: var(--a-btn); color: var(--a-text); font-size: 11.5px; }
.nxd-menu .nxd-i { width: 9px; height: 9px; }
.nxd-check { display: inline-flex; align-items: center; gap: 6px; color: var(--a-text); }
.nxd-check > i { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 4px; background: var(--a-primary); color: #fff; }
.nxd-check .nxd-i { width: 10px; height: 10px; }

/* ---- Network monitor --------------------------------------------------- */
.nxd-net { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 0 14px 0 19px; }
.nxd-net-list { width: 276px; flex: 0 0 276px; display: flex; flex-direction: column; gap: 10px; padding-top: 9px; }
.nxd-ntask {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 12px 12px 12px;
  border-radius: 12px;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  box-shadow: var(--a-shadow);
}
.nxd-ntask.is-selected { background: var(--a-select); border-color: var(--a-select-bd); }
.nxd-ntask b { display: flex; align-items: center; font-size: 13.5px; font-weight: 700; }
.nxd-ntask small { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--a-text-2); }
.nxd-ntask small > i { width: 1px; height: 10px; background: var(--a-border); }
.nxd-ntask small .nxd-i { width: 11px; height: 11px; }
.nxd-ntask small > span { display: inline-flex; align-items: center; gap: 3px; }
.nxd-ntask .nxd-status-pill { height: 21px; }
.nxd-net-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding-top: 9px; }
.nxd-nhead { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.nxd-nhead h5 { font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.nxd-nhead code { font-size: 13px; color: var(--a-text-2); }
.nxd-nhead .nxd-btn { align-self: flex-start; margin-top: 4px; }
.nxd-btn .nxd-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: nxd-spin .8s linear infinite; }
@keyframes nxd-spin { to { transform: rotate(360deg); } }
.nxd-net-detail > .nxd-card:nth-child(2) { padding: 14px 18px 16px; }
.nxd-samples { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 16px; margin-top: 14px; }
.nxd-samples > div { display: flex; flex-direction: column; gap: 4px; }
.nxd-samples small { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--a-text-2); }
.nxd-samples small .nxd-i { width: 12px; height: 12px; }
.nxd-samples b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.nxd-samples b em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--a-text-2); }
.nxd-samples.is-flash b { animation: nxd-flash .8s var(--nx-ease); }
@keyframes nxd-flash { 30% { color: var(--a-primary); } }
.nxd-trends { flex: 1; min-height: 0; padding: 14px 18px 12px; display: flex; flex-direction: column; }
.nxd-chart-head { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 11.5px; }
.nxd-chart-head b { font-weight: 600; }
.nxd-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--a-text-2); }
.nxd-legend i { width: 7px; height: 7px; border-radius: 50%; }
.nxd-blue-bg { background: var(--a-blue); }
.nxd-purple-bg { background: var(--a-purple); }
.nxd-teal-bg { background: var(--a-teal); }
.nxd-chart { display: block; width: 100%; height: 128px; margin-top: 8px; overflow: visible; }
.nxd-chart-sm { height: 70px; }
.nxd-chart .grid { stroke: var(--a-hair); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; }
.nxd-chart .ln { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.nxd-chart .ar { stroke: none; }
.nxd-chart .up { stroke: var(--a-blue); }
.nxd-chart .dn { stroke: var(--a-purple); }
.nxd-chart .rt { stroke: var(--a-teal); }
.nxd-chart .ar.up { fill: color-mix(in srgb, var(--a-blue) 14%, transparent); }
.nxd-chart .ar.dn { fill: color-mix(in srgb, var(--a-purple) 14%, transparent); }
.nxd-chart .ar.rt { fill: color-mix(in srgb, var(--a-teal) 14%, transparent); }
.nxd-chart .lbl { font: 400 9px -apple-system, BlinkMacSystemFont, sans-serif; fill: var(--a-text-3); }
.nxd-chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: nxd-draw 1.4s var(--nx-ease) forwards; }
.nxd-chart .ar { opacity: 0; animation: nxd-fadein .8s .5s forwards; }
@keyframes nxd-draw { to { stroke-dashoffset: 0; } }
@keyframes nxd-fadein { to { opacity: 1; } }

/* ---- Cursor ------------------------------------------------------------ */
.nxd-cursor {
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  will-change: transform;
}
.nxd-cursor.is-on { opacity: 1; }
.nxd-cursor > svg {
  width: 22px; height: 22px;
  fill: #111; stroke: #fff; stroke-width: 1.3; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
  transition: transform .12s;
  transform-origin: 3px 2px;
}
.nxd-cursor.is-click > svg { transform: scale(.82); }
.nxd-cursor::after {
  content: "";
  position: absolute; left: -12px; top: -12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--a-primary) 30%, transparent);
  transform: scale(0);
  opacity: 0;
}
.nxd-cursor.is-click::after { animation: nxd-ripple .5s ease-out; }
@keyframes nxd-ripple { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.nxd-drag {
  position: absolute; left: 16px; top: 16px;
  display: none; align-items: center; gap: 7px;
  padding: 5px 10px 5px 8px;
  border-radius: 8px;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  font-size: 12px;
  white-space: nowrap;
  color: var(--a-text);
  opacity: .95;
}
.nxd-drag .nxd-i { width: 16px; height: 16px; color: #9a7bd8; }
.nxd-cursor.is-dragging .nxd-drag { display: inline-flex; }

/* ---- Caption + appearance toggle -------------------------------------- */
.nxd-foot {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  max-width: 1128px;
  margin: 34px auto 0;
  position: relative;
}
.nxd-caption { max-width: 640px; text-align: center; min-height: 86px; }
.nxd-caption h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: var(--nx-text); letter-spacing: -.01em; }
.nxd-caption p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--nx-text-2); }
.nxd-appearance {
  position: absolute;
  right: 0; top: 0;
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
}
.nxd-appearance button {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--nx-text-2);
  background: transparent;
  transition: background .2s, color .2s;
}
.nxd-appearance button:hover { color: var(--nx-text); }
.nxd-appearance button.is-on { background: var(--nx-surface-2); color: var(--nx-text); }
.nxd-appearance button:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 1px; }

@media (max-width: 1100px) {
  .nxd-appearance { position: static; }
  .nxd-foot { flex-direction: column; align-items: center; gap: 16px; }
}
@media (max-width: 860px) {
  .nxd { padding: 24px 0 72px; }
  .nxd-pills { justify-content: flex-start; margin-top: 20px; }
  .nxd-pill { padding: 9px 12px 11px; font-size: 13px; gap: 6px; }
  .nxd-pill-fill { left: 12px; right: 12px; }
  .nxd-caption h3 { font-size: 17px; }
  .nxd-caption p { font-size: 13.5px; }
  .nxd-foot { margin-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .nxd-cursor { display: none; }
  .nxd-pill.is-active .nxd-pill-fill::after { animation: none; transform: scaleX(1); }
}
