/* styles.css */
/* NSD Control Panel — Stripe-inspired design tokens */

:root {
  /* Light theme (default) — enterprise palette */
  --bg: #F7F8FA;
  --bg-elev: #FFFFFF;
  --bg-sunken: #F1F3F6;
  --bg-hover: #EEF0F4;
  --bg-active: #E6E9EE;

  --surface: #FFFFFF;
  --surface-2: #F7F8FA;

  --border: #DDE1E7;
  --border-strong: #C7CDD6;
  --border-subtle: #E9ECF1;

  --ink: #0F1B2D;
  --ink-2: #2A3344;
  --ink-3: #5E6675;
  --ink-4: #8189A1;
  --ink-5: #ADB3BF;

  --accent: #1F5AB3;
  --accent-soft: #E8F0FB;
  --accent-ink: #174A98;
  --accent-2: #2E78D1;
  --accent-3: #38BDF8;

  --success: #0BA864;
  --success-soft: #DCFCE7;
  --warning: #C7811E;
  --warning-soft: #FEF3C7;
  --danger:  #DC2626;
  --danger-soft: #FEE2E2;
  --info: #0284C7;
  --info-soft: #E0F2FE;

  /* Data viz palette */
  --chart-1: #1F5AB3;
  --chart-2: #2872C9;
  --chart-3: #38BDF8;
  --chart-4: #0EA5BE;
  --chart-5: #F59E0B;
  --chart-6: #5A93E5;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.06), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, 0.10), 0 4px 8px -2px rgba(16, 24, 40, 0.06);
  --shadow-xl: 0 24px 48px -12px rgba(16, 24, 40, 0.18);

  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-xl: 10px;
  --radius-2xl: 14px;
  --radius-full: 999px;

  --density-row: 44px;
  --density-pad: 14px;
  --density-gap: 16px;
  --sidebar-w: 216px;
  --topbar-h: 56px;

  --font-sans: "Inter", "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: "Inter", "Inter Tight", -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #0A0E14;
  --bg-elev: #10141C;
  --bg-sunken: #0D1219;
  --bg-hover: #161B25;
  --bg-active: #1D2230;

  --surface: #10141C;
  --surface-2: #141925;

  --border: #232A38;
  --border-strong: #2E3645;
  --border-subtle: #1A1F2A;

  --ink: #E8ECF3;
  --ink-2: #BFC5D2;
  --ink-3: #8189A1;
  --ink-4: #5E6675;
  --ink-5: #404756;

  --accent: #4D8FE0;
  --accent-soft: rgba(77, 143, 224, 0.12);
  --accent-ink: #7AAFEC;
  --accent-2: #38BDD6;
  --accent-3: #38BDF8;

  --success: #22C55E;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger:  #F87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #38BDF8;
  --info-soft: rgba(56, 189, 248, 0.14);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.55), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, 0.6), 0 4px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
}

[data-density="compact"] {
  --density-row: 36px;
  --density-pad: 10px;
  --density-gap: 12px;
}
[data-density="spacious"] {
  --density-row: 52px;
  --density-pad: 18px;
  --density-gap: 20px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* utility */
.mono { font-family: var(--font-mono); font-feature-settings: "zero", "ss01"; }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Focus rings */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--ink-5);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Animations */
@keyframes ns-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ns-slide-up { from { transform: translateY(6px); } to { transform: translateY(0); } }
@keyframes ns-slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes ns-pulse-soft { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes ns-spin { to { transform: rotate(360deg); } }
@keyframes ns-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes ns-flow { to { stroke-dashoffset: -32; } }

.ns-fade-in { animation: ns-fade-in 200ms ease-out; animation-fill-mode: both; }
.ns-slide-up { animation: ns-slide-up 220ms cubic-bezier(0.16, 1, 0.3, 1); animation-fill-mode: both; }

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


/* ui.css */
/* NSD UI primitives — Stripe-flavored, dense and quiet */

/* ---------- Button ---------- */
.nsd-btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  font-weight: 500; font-size: 13px; line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 0 12px; height: 32px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.nsd-btn:active { transform: translateY(0.5px); }
.nsd-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.nsd-btn--sm { height: 28px; font-size: 12px; padding: 0 10px; border-radius: var(--radius-sm); }
.nsd-btn--lg { height: 40px; font-size: 14px; padding: 0 16px; }

.nsd-btn--primary {
  background: var(--ink);
  color: var(--bg-elev);
  border-color: var(--ink);
}
.nsd-btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

.nsd-btn--accent {
  background: linear-gradient(180deg, #2466BD 0%, #1F5AB3 100%);
  color: white;
  border-color: #174A98;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 1px 2px rgba(15,32,72,0.18);
}
.nsd-btn--accent:hover { background: linear-gradient(180deg, #2872C9 0%, #225FB8 100%); border-color: #1F5AB3; }
.nsd-btn--accent:active { background: linear-gradient(180deg, #1F5AB3 0%, #174A98 100%); }

.nsd-btn--secondary {
  background: var(--surface); color: var(--ink); border-color: var(--border);
}
.nsd-btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.nsd-btn--ghost {
  background: transparent; color: var(--ink-2); border-color: transparent;
  box-shadow: none;
}
.nsd-btn--ghost:hover { background: var(--bg-hover); color: var(--ink); }

.nsd-btn--danger { background: var(--danger); color: white; border-color: var(--danger); }
.nsd-btn--danger:hover { filter: brightness(0.95); }

.nsd-btn--link {
  background: transparent; border-color: transparent; color: var(--accent);
  box-shadow: none; padding: 0; height: auto;
}
.nsd-btn--link:hover { text-decoration: underline; }

.nsd-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid transparent;
  color: var(--ink-3); cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.nsd-icon-btn:hover { background: var(--bg-hover); color: var(--ink); }

/* ---------- Card ---------- */
.nsd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.nsd-card--pad { padding: 20px; }

.nsd-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.nsd-card-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.nsd-card-subtitle { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

/* ---------- Badge ---------- */
.nsd-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px;
  font-size: 11.5px; font-weight: 500;
  border-radius: var(--radius-sm);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.nsd-badge.mono { font-family: var(--font-mono); font-size: 11px; }
.nsd-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.nsd-badge--soft.nsd-badge--neutral { background: var(--bg-active); color: var(--ink-2); }
.nsd-badge--soft.nsd-badge--accent  { background: var(--accent-soft); color: var(--accent-ink); }
.nsd-badge--soft.nsd-badge--success { background: var(--success-soft); color: var(--success); }
.nsd-badge--soft.nsd-badge--warning { background: var(--warning-soft); color: var(--warning); }
.nsd-badge--soft.nsd-badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.nsd-badge--soft.nsd-badge--info    { background: var(--info-soft);    color: var(--info); }

.nsd-badge--solid.nsd-badge--neutral { background: var(--ink-2); color: var(--bg-elev); }
.nsd-badge--solid.nsd-badge--accent  { background: var(--accent); color: white; }
.nsd-badge--solid.nsd-badge--success { background: var(--success); color: white; }
.nsd-badge--solid.nsd-badge--warning { background: var(--warning); color: white; }
.nsd-badge--solid.nsd-badge--danger  { background: var(--danger);  color: white; }

[data-theme="dark"] .nsd-badge--soft.nsd-badge--success { color: #34D399; }
[data-theme="dark"] .nsd-badge--soft.nsd-badge--warning { color: #FBBF24; }

/* ---------- Status dot ---------- */
.nsd-status-dot {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 10px; height: 10px;
}
.nsd-status-dot__core {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--success));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--success)) 18%, transparent);
}
.nsd-status-dot__pulse {
  position: absolute; inset: 0;
  border-radius: 50%; border: 2px solid var(--c);
  animation: ns-pulse-soft 1.6s ease-in-out infinite;
}

/* ---------- Avatar ---------- */
.nsd-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: white; font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Input ---------- */
.nsd-input {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
}
.nsd-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.nsd-input input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--ink); font-size: 13px;
}
.nsd-input input::placeholder { color: var(--ink-4); }
.nsd-input__icon { color: var(--ink-4); }
.nsd-input__suffix { color: var(--ink-4); font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }

/* ---------- Kbd ---------- */
.nsd-kbd {
  display: inline-flex; align-items: center;
  height: 18px; padding: 0 5px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
}

/* ---------- Switch ---------- */
.nsd-switch {
  position: relative; width: 32px; height: 18px;
  background: var(--ink-5); border-radius: 999px; border: 0;
  cursor: pointer; transition: background 150ms ease; padding: 0;
}
.nsd-switch.is-on { background: var(--accent); }
.nsd-switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: white; transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.nsd-switch.is-on .nsd-switch__thumb { transform: translateX(14px); }

/* ---------- Tabs ---------- */
.nsd-tabs {
  display: inline-flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0; padding: 0;
  width: 100%;
}
.nsd-tab {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0;
  padding: 10px 12px;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  cursor: pointer; position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
}
.nsd-tab:hover { color: var(--ink); }
.nsd-tab.is-active {
  color: var(--ink); border-bottom-color: var(--ink);
}
.nsd-tab__count {
  background: var(--bg-active); color: var(--ink-3); font-size: 11px;
  padding: 1px 6px; border-radius: 999px; font-weight: 500;
}
.nsd-tab.is-active .nsd-tab__count { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Segmented ---------- */
.nsd-seg {
  display: inline-flex; padding: 2px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.nsd-seg__item {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 0; padding: 0 10px;
  height: 26px; white-space: nowrap;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.nsd-seg__item:hover { color: var(--ink); }
.nsd-seg__item.is-active {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.nsd-seg--sm .nsd-seg__item { height: 22px; font-size: 11.5px; padding: 0 8px; }

/* Equal-width tab items (used in Settings, etc.) */
.nsd-settings-tabs .nsd-seg__item { min-width: 120px; justify-content: center; }

/* ---------- Empty state ---------- */
.nsd-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 40px 24px;
  color: var(--ink-3);
}
.nsd-empty__art { margin-bottom: 14px; }
.nsd-empty__title { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.nsd-empty__desc { margin-top: 6px; max-width: 360px; line-height: 1.55; font-size: 13px; }
.nsd-empty__action { margin-top: 16px; }

/* ---------- Skeleton ---------- */
.nsd-skel {
  display: inline-block;
  background: linear-gradient(90deg, var(--bg-sunken) 0%, var(--bg-hover) 50%, var(--bg-sunken) 100%);
  background-size: 200% 100%;
  animation: ns-shimmer 1.4s ease-in-out infinite;
}

/* ---------- Code ---------- */
.nsd-code {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  overflow: hidden;
}
.nsd-code__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-code__lang { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em; }
.nsd-code__copy {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 0;
  color: var(--ink-3); font-size: 11.5px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: background 120ms ease, color 120ms ease;
}
.nsd-code__copy:hover { background: var(--bg-hover); color: var(--ink); }
.nsd-code__pre {
  font-family: var(--font-mono); font-size: 12.5px;
  margin: 0; padding: 12px 14px;
  color: var(--ink-2);
  overflow-x: auto;
  line-height: 1.6;
}
.nsd-code__row { display: flex; gap: 10px; }
.nsd-code__ln { color: var(--ink-5); user-select: none; min-width: 18px; text-align: right; }
.nsd-code__src { white-space: pre; }

/* Native <select> styled to match Input */
select.nsd-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px !important;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  height: 32px !important;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  vertical-align: middle;
}
select.nsd-input:hover { border-color: var(--border-strong); }
select.nsd-input:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
[data-theme="dark"] select.nsd-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C94A6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
}
select.nsd-input option {
  background: var(--surface);
  color: var(--ink);
  padding: 6px 8px;
}
.nsd-inline-code {
  font-family: var(--font-mono); font-size: 12px;
  padding: 1px 5px;
  background: var(--bg-sunken); border: 1px solid var(--border-subtle);
  border-radius: 4px; color: var(--ink-2);
}

/* ---------- Tooltip ---------- */
.nsd-tt { position: relative; display: inline-flex; }
.nsd-tt::after {
  content: attr(data-tt);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg-elev);
  padding: 4px 8px; font-size: 11px; border-radius: 4px;
  white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity 120ms ease;
  z-index: 100;
}
.nsd-tt:hover::after { opacity: 1; }
.nsd-tt--right::after { bottom: auto; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }

/* ---------- Dialog / Drawer ---------- */
.nsd-dialog-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 18, 24, 0.4);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.nsd-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
}
.nsd-dialog--lg { max-width: 720px; }
.nsd-dialog--xl { max-width: 960px; }
.nsd-dialog__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-dialog__title { font-weight: 600; font-size: 15px; color: var(--ink); }
.nsd-dialog__subtitle { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.nsd-dialog__body { padding: 20px; overflow: auto; }
.nsd-dialog__foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-2);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}
.nsd-drawer {
  background: var(--surface);
  border-left: 1px solid var(--border);
  height: 100vh; box-shadow: var(--shadow-xl);
  margin-left: auto;
  display: flex; flex-direction: column;
  animation: ns-slide-in-right 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nsd-drawer__body { padding: 18px 20px; overflow: auto; flex: 1; }

/* ---------- Toasts ---------- */
.nsd-toasts {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.nsd-toast {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px;
  box-shadow: var(--shadow-md); font-size: 13px;
  color: var(--ink);
  pointer-events: auto;
}
.nsd-toast--success { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); color: var(--success); }
.nsd-toast--error   { border-color: color-mix(in srgb, var(--danger) 50%, var(--border));  color: var(--danger); }

/* ---------- Table ---------- */
.nsd-table-wrap { overflow: auto; }
.nsd-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.nsd-table th {
  text-align: left; font-weight: 500; color: var(--ink-3);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  white-space: nowrap;
}
.nsd-table th:first-child { border-top-left-radius: var(--radius-md); border-left: 1px solid var(--border); }
.nsd-table th:last-child  { border-top-right-radius: var(--radius-md); border-right: 1px solid var(--border); }
.nsd-table td {
  padding: 0 14px; height: var(--density-row);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink); vertical-align: middle;
}
.nsd-table td:first-child { border-left: 1px solid var(--border); }
.nsd-table td:last-child  { border-right: 1px solid var(--border); }
.nsd-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-md); }
.nsd-table tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--radius-md); }
.nsd-table tbody tr.is-clickable { cursor: pointer; }
.nsd-table tbody tr:hover td { background: var(--surface-2); }
.nsd-table-empty { padding: 24px; }

/* ---------- Ring ---------- */
.nsd-ring { position: relative; display: inline-block; }
.nsd-ring__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.nsd-ring__val { font-size: 16px; font-weight: 600; color: var(--ink); }
.nsd-ring__val span { font-size: 10px; color: var(--ink-3); margin-left: 1px; }
.nsd-ring__label { font-size: 10px; color: var(--ink-3); margin-top: -2px; }

/* ---------- Dot grid ---------- */
.nsd-dotgrid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.6; }

/* ---------- Page header ---------- */
.nsd-page-header { margin-bottom: 22px; }
.nsd-page-header__row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.nsd-page-header__title-block { min-width: 0; flex: 1; }
.nsd-page-header__actions { display: flex; gap: 8px; align-items: center; }
.nsd-page-header__tabs { margin-top: 18px; }
.nsd-eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.nsd-page-title {
  margin: 0;
  font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.014em;
  color: var(--ink);
}
.nsd-page-subtitle { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; max-width: 720px; line-height: 1.55; }

/* ---------- Detail header meta row ---------- */
.nsd-meta-row { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; align-items: center; }
.nsd-meta-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--bg-active); border: 1px solid var(--border); font-size: 11.5px; line-height: 1; color: var(--ink-2); white-space: nowrap; }
.nsd-meta-chip__k { color: var(--ink-4); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.nsd-meta-chip__v { color: var(--ink-2); font-weight: 500; }
.nsd-meta-chip.mono .nsd-meta-chip__v { font-family: var(--font-mono); font-weight: 500; }

/* ---------- Shared layout helpers ---------- */
.nsd-grid-cards { display: grid; gap: var(--density-gap); }
.nsd-flex { display: flex; }
.nsd-flex-col { display: flex; flex-direction: column; }
.nsd-items-center { align-items: center; }
.nsd-justify-between { justify-content: space-between; }
.nsd-gap-2 { gap: 8px; }
.nsd-gap-3 { gap: 12px; }
.nsd-gap-4 { gap: 16px; }
.nsd-gap-6 { gap: 24px; }

/* Prominent install-method toggle (Quick Start) */
.nsd-qs-method { display: inline-flex; padding: 3px; background: var(--bg-sunken); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.nsd-qs-method .nsd-seg__item { height: 34px; font-size: 13px; font-weight: 600; padding: 0 16px; min-width: 200px; justify-content: center; }
.nsd-qs-method .nsd-seg__item.is-active { background: var(--accent-soft); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent) inset; }
.nsd-qs-method .nsd-seg__item.is-active svg { color: var(--accent-ink); }

/* Bare code block — copy button floats over the code, no header bar (Quick Start) */
.nsd-code--bare { position: relative; }
.nsd-code__copy--float { position: absolute; top: 6px; right: 6px; z-index: 1; background: var(--bg-elev); border: 1px solid var(--border); }


/* shell.css */
/* App shell styles */

.nsd-app { display: flex; min-height: 100vh; background: var(--bg); }

/* ---------- Sidebar (dark enterprise) ---------- */
.nsd-sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(170deg, #0A1A33 0%, #142F5B 70%, #1B3B6F 100%);
  border-right: 1px solid #1B3158;
  color: rgba(255,255,255,0.88);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.nsd-sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.6;
}
.nsd-sidebar > * { position: relative; z-index: 1; }
.nsd-sidebar.is-collapsed { width: 56px; }

.nsd-sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nsd-brand-name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.005em; color: white; }
.nsd-brand-org { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 1px; }

.nsd-sidebar__search { padding: 10px 12px 6px; }
.nsd-sidebar__search .nsd-input {
  height: 30px;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}
.nsd-sidebar__search .nsd-input input { color: rgba(255,255,255,0.95); }
.nsd-sidebar__search .nsd-input input::placeholder { color: rgba(255,255,255,0.4); }
.nsd-sidebar__search .nsd-input__icon { color: rgba(255,255,255,0.55); }
.nsd-sidebar__search .nsd-kbd {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  box-shadow: none;
}

.nsd-sidebar__nav { flex: 1; overflow-y: auto; padding: 10px 8px 12px; }
.nsd-nav-section { margin-top: 14px; }
.nsd-nav-section:first-child { margin-top: 6px; }
.nsd-nav-section__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45); font-weight: 600;
  padding: 6px 10px 4px;
}
.nsd-nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.72);
  background: transparent; border: 0;
  border-radius: var(--radius-md); cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
  position: relative;
}
.nsd-nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nsd-nav-item.is-active {
  background: rgba(95,163,245,0.12);
  color: white;
}
.nsd-nav-item.is-active::before {
  content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px;
  width: 2px; background: #5FA3F5; border-radius: 0 2px 2px 0;
}
.nsd-nav-item.is-active svg { color: #5FA3F5; }
.is-collapsed .nsd-nav-item { justify-content: center; padding: 8px; }

/* Bottom user pill */
.nsd-sidebar__user {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 8px 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
}
.nsd-sidebar__user-info { flex: 1; min-width: 0; }
.nsd-sidebar__user-name {
  font-size: 12.5px; font-weight: 600; color: white;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nsd-sidebar__user-meta {
  font-size: 10.5px; color: rgba(255,255,255,0.55);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 1px;
}
.nsd-sidebar__user-badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 5px; border-radius: 3px;
  background: rgba(95,163,245,0.18); color: #7AAFEC;
}

.nsd-sidebar__footer {
  padding: 10px 14px; border-top: 1px solid var(--border-subtle);
}
.nsd-sidebar__release { display: flex; align-items: center; gap: 6px; }
.nsd-sidebar__health {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-3);
  margin-top: 8px;
}

/* ---------- Main area ---------- */
.nsd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nsd-topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 30;
}
.nsd-topbar__left { display: flex; align-items: center; gap: 12px; }
.nsd-topbar__breadcrumb { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.nsd-topbar__sep { color: var(--ink-5); }
.nsd-topbar__right { display: flex; align-items: center; gap: 6px; position: relative; }
.nsd-topbar__btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 8px; min-width: 32px; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-md); color: var(--ink-2);
  cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.nsd-topbar__btn:hover { background: var(--bg-hover); color: var(--ink); }
.nsd-topbar__dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-elev);
}
.nsd-topbar__divider {
  width: 1px; height: 18px; background: var(--border); margin: 0 4px;
}
.nsd-topbar__search {
  display: flex; gap: 8px; align-items: center;
  height: 32px; padding: 0 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--ink-4);
  flex: 1; margin: 0 16px;
  max-width: 640px;
  transition: border-color 120ms ease, background 120ms ease;
}
.nsd-topbar__search:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.nsd-topbar__search-placeholder { flex: 1; text-align: left; font-size: 12.5px; color: var(--ink-4); }
.nsd-topbar__search-kbd { display: inline-flex; gap: 3px; }
@media (max-width: 720px) { .nsd-topbar__search { min-width: 0; } .nsd-topbar__search-placeholder { display: none; } }
.nsd-topbar__user {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-md); padding: 3px 8px 3px 3px;
  cursor: pointer; transition: background 120ms ease, border-color 120ms ease;
}
.nsd-topbar__user:hover { background: var(--bg-hover); border-color: var(--border); }
.nsd-topbar__user-text { line-height: 1.1; white-space: nowrap; }
.nsd-topbar__user-name { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.nsd-topbar__user-email { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.nsd-popover {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 4px; min-width: 200px; z-index: 50;
  animation: ns-slide-up 160ms ease-out;
}
.nsd-popover__item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 8px; background: transparent; border: 0;
  border-radius: 4px; cursor: pointer; color: var(--ink-2);
  font-size: 13px; text-align: left;
}
.nsd-popover__item:hover { background: var(--bg-hover); color: var(--ink); }
.nsd-popover__item--danger { color: var(--danger); }
.nsd-popover__sep { height: 1px; background: var(--border-subtle); margin: 4px 0; }

/* ---------- Page wrap ---------- */
.nsd-page { padding: 28px 28px 48px; max-width: 1440px; margin: 0 auto; width: 100%; }

/* ---------- Activity Drawer ---------- */
.nsd-activity-drawer .nsd-dialog__title { display: inline-flex; align-items: center; }
.nsd-activity__body { padding: 18px 20px; overflow: auto; flex: 1; }
.nsd-activity__stream { position: relative; }
.nsd-activity__item {
  display: flex; gap: 10px;
  padding: 8px 0;
  animation: ns-slide-up 280ms ease-out backwards;
}
.nsd-activity__rail {
  width: 12px; flex-shrink: 0; position: relative;
}
.nsd-activity__rail::before {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}
.nsd-activity__item:last-child .nsd-activity__rail::before { display: none; }
.nsd-activity__pin {
  position: absolute; top: 8px; left: 1px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--bg-elev);
  border: 2px solid var(--ink-4);
}
.nsd-activity__item--auth .nsd-activity__pin { border-color: var(--accent); }
.nsd-activity__item--dist .nsd-activity__pin { border-color: var(--accent-2); }
.nsd-activity__item--join .nsd-activity__pin { border-color: var(--success); }
.nsd-activity__item--deny .nsd-activity__pin { border-color: var(--danger); }
.nsd-activity__item--ok .nsd-activity__pin { border-color: var(--success); }
.nsd-activity__content { flex: 1; min-width: 0; padding-bottom: 4px; border-bottom: 1px dashed var(--border-subtle); }
.nsd-activity__text { font-size: 13px; color: var(--ink); }
.nsd-activity__meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.nsd-activity__chart {
  margin-top: 18px; padding: 12px;
  background: var(--bg-sunken); border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
}
.nsd-activity__chart-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }

/* ---------- Command Palette ---------- */
.nsd-palette-overlay { align-items: flex-start; padding-top: 14vh; }
.nsd-palette {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 600px;
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  max-height: 60vh;
  overflow: hidden;
}
.nsd-palette__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-palette__head input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 15px; color: var(--ink);
}
.nsd-palette__icon { color: var(--ink-4); }
.nsd-palette__list { flex: 1; overflow-y: auto; padding: 6px; }
.nsd-palette__group {
  padding: 8px 10px 4px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-4); font-weight: 600;
}
.nsd-palette__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: transparent; border: 0;
  border-radius: 6px; cursor: pointer;
  color: var(--ink-2); text-align: left;
}
.nsd-palette__item:hover { background: var(--bg-hover); color: var(--ink); }
.nsd-palette__item-text { flex: 1; min-width: 0; }
.nsd-palette__item-title { font-size: 13px; font-weight: 500; }
.nsd-palette__item-subtitle { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.nsd-palette__arrow { color: var(--ink-4); opacity: 0; }
.nsd-palette__item:hover .nsd-palette__arrow { opacity: 1; }
.nsd-palette__foot {
  display: flex; gap: 14px; padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-2);
  font-size: 11px; color: var(--ink-3);
}
.nsd-palette__foot > div { display: inline-flex; gap: 4px; align-items: center; }

/* Login chrome */
.nsd-login2 {
  min-height: 100vh; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}

/* Animated background */
.nsd-login2__bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  pointer-events: none;
}
.nsd-login2__orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.32;
  animation: ns-orb 18s ease-in-out infinite;
}
.nsd-login2__orb--1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #1F5AB3 0%, transparent 70%);
  top: -120px; left: -120px;
  animation-delay: 0s;
}
.nsd-login2__orb--2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #2E78D1 0%, transparent 70%);
  bottom: -160px; right: -120px;
  animation-delay: -6s;
}
.nsd-login2__orb--3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #0E5FAD 0%, transparent 70%);
  top: 40%; left: 60%;
  opacity: 0.32;
  animation-delay: -12s;
}
[data-theme="dark"] .nsd-login2__orb { opacity: 0.42; }
[data-theme="dark"] .nsd-login2__orb--3 { opacity: 0.22; }
.nsd-login2__grid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--ink-4);
  opacity: 0.45;
}

@keyframes ns-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 40px) scale(0.96); }
}

/* Chrome (logo + lang/theme switches) */
.nsd-login2__chrome {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 28px;
}
.nsd-login2__brand-row { display: inline-flex; gap: 10px; align-items: center; }
.nsd-login2__mark { display: inline-flex; }
.nsd-login2__brand-name {
  font-weight: 600; letter-spacing: 0.04em;
  font-size: 13px; color: var(--ink);
}

/* Main content */
.nsd-login2__main {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 28px 40px;
  justify-content: center;
  gap: 36px;
}

/* Card */
.nsd-login2__card {
  width: 100%; max-width: 420px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow:
    0 1px 0 color-mix(in srgb, white 50%, transparent) inset,
    0 30px 60px -20px rgba(15, 18, 28, 0.18),
    0 8px 24px -8px rgba(15, 18, 28, 0.10);
  animation: ns-slide-up 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .nsd-login2__card {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow:
    0 1px 0 color-mix(in srgb, white 6%, transparent) inset,
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 8px 24px -8px rgba(0, 0, 0, 0.4);
}

.nsd-login2__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.nsd-login2__eyebrow .nsd-live-pulse__dot { width: 6px; height: 6px; }

.nsd-login2__title {
  font-size: 30px; font-weight: 600; letter-spacing: -0.022em;
  margin: 0;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nsd-login2__subtitle {
  font-size: 14px; color: var(--ink-3); margin: 8px 0 0;
  line-height: 1.55;
}

.nsd-login2__form {
  margin-top: 26px;
  display: flex; flex-direction: column; gap: 12px;
}
.nsd-login2__field { text-align: left; }
.nsd-login2__field label {
  display: block; font-size: 12px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 6px;
}

.nsd-login2__divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0;
  color: var(--ink-4); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
}
.nsd-login2__divider::before,
.nsd-login2__divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.nsd-login2__hint {
  margin-top: 18px; padding: 9px 12px;
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: var(--radius-md);
  font-size: 12px; color: var(--ink-2);
  display: flex; gap: 8px; align-items: center;
}
.nsd-login2__hint code { background: transparent; border: 0; padding: 0; color: var(--accent-ink); font-weight: 500; }

/* Feature row below card */
.nsd-login2__features {
  display: flex; gap: 32px; flex-wrap: wrap; justify-content: center;
  max-width: 720px;
  animation: ns-slide-up 480ms cubic-bezier(0.16, 1, 0.3, 1) 80ms backwards;
}
.nsd-login2__feature {
  display: flex; gap: 10px; align-items: flex-start;
  min-width: 180px; max-width: 220px;
}
.nsd-login2__feature-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: color-mix(in srgb, var(--accent-soft) 80%, transparent);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.nsd-login2__feature-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.nsd-login2__feature-text { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.55; }

.nsd-login2__foot {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between;
  padding: 14px 28px 20px;
  font-size: 11px; color: var(--ink-4);
}

@media (max-width: 640px) {
  .nsd-login2__card { padding: 28px 22px 22px; max-width: 100%; }
  .nsd-login2__title { font-size: 24px; }
  .nsd-login2__features { display: none; }
  .nsd-login2__foot { flex-direction: column; gap: 4px; align-items: center; }
}

/* ---------- Responsive: mobile / tablet ---------- */
.nsd-topbar__hamburger { display: none !important; }

@media (max-width: 960px) {
  .nsd-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
    width: 280px;
    box-shadow: var(--shadow-xl);
  }
  .nsd-sidebar.is-open { transform: translateX(0); }
  .nsd-mobile-overlay {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(15, 18, 24, 0.4);
    backdrop-filter: blur(2px);
    animation: ns-fade-in 200ms ease-out;
  }
  .nsd-topbar { padding: 0 12px; }
  .nsd-topbar__hamburger { display: inline-flex !important; }
  .nsd-page { padding: 18px 14px 32px; }
  .nsd-page-title { font-size: 20px; }
  .nsd-page-header__row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .nsd-page-header__actions { width: 100%; flex-wrap: wrap; }
  .nsd-detail-grid { grid-template-columns: 1fr !important; }
  .nsd-list-head { flex-wrap: wrap; }
  .nsd-list-head .nsd-input { width: 100% !important; }
  .nsd-settings { grid-template-columns: 1fr !important; gap: 16px; }
  .nsd-acl-stat-row { grid-template-columns: 1fr 1fr !important; }
  .nsd-acl-stat { border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .nsd-audit-filters { grid-template-columns: 1fr 1fr !important; }
  .nsd-portal-grid-dense, .nsd-svc-grid { grid-template-columns: 1fr 1fr !important; }
  .nsd-portal-downloads { grid-template-columns: 1fr !important; }
  .nsd-topbar__user-text { display: none; }
}

@media (max-width: 640px) {
  .nsd-kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .nsd-acl-stat-row { grid-template-columns: 1fr !important; }
  .nsd-audit-filters { grid-template-columns: 1fr !important; }
  .nsd-portal-grid-dense, .nsd-svc-grid { grid-template-columns: 1fr !important; }
  .nsd-page { padding: 16px 12px 32px; }
  .nsd-dialog { max-width: calc(100vw - 24px) !important; margin: 12px; }
  .nsd-drawer { width: 100vw !important; }
  .nsd-topo-page__svg { height: 360px; }
  .nsd-feed-row { grid-template-columns: minmax(44px, 60px) minmax(0, 1fr) 92px !important; gap: 8px !important; }
  .nsd-feed-action, .nsd-feed-resource { display: none; }
}

/* ============================================
   Enterprise login (replaces .nsd-login2)
   ============================================ */
.nsd-enterprise-login {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.nsd-enterprise-login__left {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0A1A33 0%, #142F5B 55%, #1F4A8C 100%);
  color: white;
  padding: 40px 52px;
  display: flex; flex-direction: column; gap: 40px;
}
.nsd-enterprise-login__pattern { position: absolute; inset: 0; pointer-events: none; opacity: 0.6; }
.nsd-enterprise-login__pattern svg { width: 100%; height: 100%; }
.nsd-enterprise-login__brand {
  position: relative; z-index: 1;
  display: flex; gap: 14px; align-items: center;
}
.nsd-enterprise-login__logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  display: inline-flex; align-items: center; justify-content: center;
}
.nsd-enterprise-login__brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.06em; }
.nsd-enterprise-login__brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.nsd-enterprise-login__brand-full { font-size: 11px; color: rgba(255,255,255,0.55); letter-spacing: 0.04em; font-weight: 500; }
.nsd-enterprise-login__brand-tag { font-size: 11px; opacity: 0.7; margin-top: 2px; letter-spacing: 0.02em; }

.nsd-enterprise-login__features {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  align-self: stretch;
}
.nsd-enterprise-login__features > * {
  width: 100%;
  max-width: 460px;
  margin-left: 0 !important;
  margin-right: auto;
}
.nsd-enterprise-login__pitch {
  font-size: 32px; line-height: 1.2; letter-spacing: -0.022em;
  font-weight: 600; margin: 0 0 36px;
  max-width: 460px;
}
.nsd-enterprise-login__keywords {
  display: grid; grid-template-columns: 1fr;
  gap: 12px;
  justify-content: start;
}
.nsd-enterprise-login__topology {
  width: 100%;
  max-width: 460px;
  margin: 0 auto 28px 0;
  opacity: 0.95;
  align-self: flex-start;
}
.nsd-enterprise-login__topology svg {
  width: 100%; height: auto; display: block;
}
.nsd-enterprise-login__kw {
  display: inline-flex; gap: 10px; align-items: center;
  font-size: 13.5px; font-weight: 500;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
}
.nsd-enterprise-login__kw svg { color: #5FA3F5; flex-shrink: 0; }

.nsd-enterprise-login__keywords--detail {
  display: flex; flex-direction: column;
  grid-template-columns: none;
  gap: 16px;
  max-width: 460px;
}
.nsd-enterprise-login__kwd {
  display: flex; gap: 12px; align-items: flex-start;
}
.nsd-enterprise-login__kwd-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 6px;
  background: rgba(95,163,245,0.14);
  color: #5FA3F5;
  display: inline-flex; align-items: center; justify-content: center;
}
.nsd-enterprise-login__kwd-title {
  font-size: 13.5px; font-weight: 600; color: white;
  letter-spacing: -0.005em;
}
.nsd-enterprise-login__kwd-text {
  font-size: 12px; color: rgba(255,255,255,0.6);
  margin-top: 2px; line-height: 1.5;
}
.nsd-enterprise-login__bullets {
  display: flex; flex-direction: column; gap: 12px;
}
.nsd-enterprise-login__bullet {
  display: flex; gap: 12px; align-items: flex-start;
}
.nsd-enterprise-login__bullet-icon {
  width: 26px; height: 26px; border-radius: 6px;
  background: rgba(255,255,255,0.1);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nsd-enterprise-login__bullet-text { font-size: 13px; line-height: 1.55; opacity: 0.92; padding-top: 4px; }

.nsd-enterprise-login__foot-left {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: rgba(255,255,255,0.55);
}
.nsd-enterprise-login__trust {
  display: inline-flex; gap: 10px; align-items: center;
  font-weight: 600; letter-spacing: 0.04em;
}
.nsd-enterprise-login__version { font-family: var(--font-mono); }

/* Right panel */
.nsd-enterprise-login__right {
  position: relative;
  background: var(--bg-elev);
  display: flex; flex-direction: column;
  padding: 32px 48px 40px;
}
.nsd-enterprise-login__top-controls {
  display: flex; justify-content: flex-end; gap: 4px;
}
.nsd-enterprise-login__form-wrap {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 380px; width: 100%; align-self: center;
}
.nsd-enterprise-login__realm-pill {
  display: inline-flex; gap: 8px; align-items: center;
  padding: 4px 10px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px; color: var(--ink-3);
  align-self: flex-start;
  margin-bottom: 18px;
}
.nsd-enterprise-login__title {
  font-size: 26px; font-weight: 600; letter-spacing: -0.018em;
  margin: 0 0 28px;
  color: var(--ink);
}
.nsd-enterprise-login__form-sub {
  font-size: 13.5px; color: var(--ink-3); line-height: 1.55;
  margin: 8px 0 24px;
}
.nsd-enterprise-login__form {
  display: flex; flex-direction: column; gap: 14px;
}
.nsd-enterprise-login__field label {
  display: block; font-size: 12px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 6px;
}
.nsd-enterprise-login__divider {
  display: flex; align-items: center; justify-content: center;
  margin: 8px 0;
  font-size: 11px; color: var(--ink-4); letter-spacing: 0.06em; text-transform: uppercase;
  position: relative;
}
.nsd-enterprise-login__divider span { padding: 0 12px; background: var(--bg-elev); position: relative; z-index: 1; }
.nsd-enterprise-login__divider::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border);
}
.nsd-enterprise-login__sso { display: flex; gap: 8px; }
.nsd-enterprise-login__hint {
  margin-top: 22px; padding: 10px 12px;
  background: var(--bg-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px; color: var(--ink-3);
  display: flex; gap: 8px; align-items: center;
}
.nsd-enterprise-login__hint code { background: transparent; border: 0; padding: 0; color: var(--ink-2); }

.nsd-login-demo {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 6px;
}
.nsd-login-demo__title {
  font-size: 11px; color: var(--ink-4); text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 600; margin-bottom: 2px;
}
.nsd-login-demo__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-sunken); cursor: pointer; font-size: 12.5px;
  transition: border-color 120ms ease, background 120ms ease;
}
.nsd-login-demo__row:hover { border-color: var(--accent); background: var(--bg-hover); }

.nsd-enterprise-login__foot-right {
  display: flex; gap: 8px; justify-content: center;
  font-size: 11.5px; color: var(--ink-4);
}
.nsd-enterprise-login__foot-right a { cursor: pointer; }
.nsd-enterprise-login__foot-right a:hover { color: var(--accent); }

@media (max-width: 920px) {
  .nsd-enterprise-login { grid-template-columns: 1fr; }
  .nsd-enterprise-login__left { display: none; }
}

/* Sidebar enterprise refresh */
.nsd-sidebar__org {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px;
  margin: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.nsd-sidebar__org:hover { border-color: var(--accent); background: var(--bg-hover); }
.nsd-sidebar__org-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: white; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.nsd-sidebar__org-info { flex: 1; min-width: 0; }
.nsd-sidebar__org-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nsd-sidebar__org-realm {
  font-size: 10.5px; color: var(--ink-3); margin-top: 1px;
  display: inline-flex; gap: 4px; align-items: center;
}
.nsd-sidebar__env-badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  background: var(--success-soft); color: var(--success);
  text-transform: uppercase; letter-spacing: 0.04em;
}


/* screens.css */
/* Screen-specific styles */

/* ---------- Dashboard ---------- */
.nsd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.nsd-kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1280px) { .nsd-kpi-grid { grid-template-columns: repeat(3, 1fr); } .nsd-kpi-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .nsd-kpi-grid, .nsd-kpi-grid--4 { grid-template-columns: repeat(2, 1fr); } }

.nsd-kpi {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 14px 8px;
  cursor: pointer; text-align: left;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.nsd-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.nsd-kpi__head { display: flex; align-items: center; gap: 6px; }
.nsd-kpi__icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.nsd-kpi__label { font-size: 11.5px; color: var(--ink-3); font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsd-kpi__arrow { color: var(--ink-4); margin-left: auto; opacity: 0; transition: opacity 120ms ease; }
.nsd-kpi:hover .nsd-kpi__arrow { opacity: 1; }
.nsd-kpi__value { margin-top: 6px; font-size: 26px; font-weight: 600; letter-spacing: -0.018em; line-height: 1; }
.nsd-kpi__foot { margin-top: 4px; display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-3); min-width: 0; }
.nsd-kpi__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.nsd-kpi__delta {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 0 4px; height: 16px; border-radius: 3px;
  font-size: 10.5px; font-weight: 600;
  background: var(--bg-active); color: var(--ink-3);
}
.nsd-kpi__delta.is-up { background: var(--success-soft); color: var(--success); }
.nsd-kpi__delta.is-down { background: var(--danger-soft); color: var(--danger); }
.nsd-kpi__spark { margin-top: 8px; }
.nsd-kpi__spark svg { width: 100%; height: 28px; display: block; }

/* Topology mini */
.nsd-topo { padding: 12px 8px 16px; }
.nsd-topo svg { width: 100%; height: auto; max-height: 280px; }

.nsd-topo-legend {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-right: 1px solid var(--border-subtle);
}
.nsd-topo-legend:last-child { border-right: 0; }
.nsd-topo-legend__dot { width: 8px; height: 8px; border-radius: 2px; }
.nsd-topo-legend__label { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.nsd-topo-legend__cap { font-size: 10.5px; color: var(--ink-3); }
.nsd-topo-legend__val { margin-left: auto; font-size: 16px; font-weight: 600; }

/* Recent activity feed */
.nsd-feed { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.nsd-feed-row {
  display: grid;
  min-width: 0;
  max-width: 100%;
  /* Keep row-local grids aligned by pinning the status column width. */
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.1fr) 112px;
  gap: 12px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
}
.nsd-feed-row > :last-child { justify-self: start; min-width: 0; overflow: visible; }
.nsd-feed-row > :last-child .nsd-badge { white-space: nowrap; }
.nsd-feed-row:first-child { border-top: 0; }
.nsd-feed-time { color: var(--ink-3); font-size: 11px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nsd-feed-actor { display: flex; align-items: center; gap: 7px; min-width: 0; }
.nsd-feed-actor span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsd-feed-action { color: var(--ink); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsd-feed-resource { color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Health rows (Dashboard) */
.nsd-health-list { display: flex; flex-direction: column; }
.nsd-health-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}
.nsd-health-row:first-child { border-top: 0; padding-top: 4px; }
.nsd-health-row:last-child { padding-bottom: 4px; }
.nsd-health-row__main { display: flex; gap: 10px; align-items: center; }
.nsd-health-row__label { font-size: 13px; font-weight: 500; color: var(--ink); }
.nsd-health-row__detail { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* Health chip */
.nsd-health-chip { display: flex; gap: 10px; align-items: center; }

/* Quick actions */
.nsd-quick-action {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer;
  font-size: 12.5px; color: var(--ink-2);
  transition: border-color 120ms ease, background 120ms ease;
  text-align: left;
}
.nsd-quick-action:hover { border-color: var(--accent); color: var(--ink); background: var(--bg-hover); }
.nsd-quick-action span { flex: 1; }
.nsd-quick-action__arrow { color: var(--ink-4); opacity: 0; transition: opacity 120ms; }
.nsd-quick-action:hover .nsd-quick-action__arrow { opacity: 1; }

/* Transport bars */
.nsd-transport { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.nsd-transport__row { display: grid; grid-template-columns: 70px 1fr 36px; gap: 10px; align-items: center; }
.nsd-transport__name { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.nsd-transport__bar { height: 6px; background: var(--bg-active); border-radius: 999px; overflow: hidden; }
.nsd-transport__bar span { display: block; height: 100%; border-radius: 999px; transition: width 400ms ease; }
.nsd-transport__val { font-size: 11.5px; color: var(--ink-3); text-align: right; }

/* ---------- Generic list table head ---------- */
.nsd-list-head {
  display: flex; gap: 10px; align-items: center;
  margin: 8px 0 14px;
}
.nsd-list-head .nsd-input { width: 320px; }
.nsd-list-head__filter { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Matrix table ---------- */
.nsd-matrix-wrap { overflow: auto; }
.nsd-matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.nsd-matrix th, .nsd-matrix td { padding: 8px; }
.nsd-matrix th:first-child { background: var(--surface-2); }
.nsd-matrix__col-head {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  height: 96px;
}
.nsd-matrix__col-head div:last-child { margin-top: 4px; }
.nsd-matrix__row-head {
  background: var(--surface-2); border-right: 1px solid var(--border);
  white-space: nowrap; min-width: 200px;
}
.nsd-matrix__cell {
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  text-align: center; vertical-align: middle; height: 40px;
}
.nsd-matrix__allow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px;
  background: var(--success-soft); color: var(--success);
}
.nsd-matrix__deny {
  display: inline-block; width: 22px; height: 22px; border-radius: 4px;
  background: var(--bg-sunken);
  background-image: repeating-linear-gradient(45deg, transparent 0, transparent 3px, var(--border) 3px, var(--border) 4px);
}
.nsd-tag {
  display: inline-flex; align-items: center;
  height: 18px; padding: 0 6px;
  font-size: 11px; font-weight: 500;
  background: var(--bg-active); color: var(--ink-2);
  border-radius: 3px;
}

/* ---------- Site group (Services page, by-site view) ---------- */
.nsd-site-group { overflow: hidden; }
.nsd-site-group__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.nsd-site-group__toggle {
  background: transparent; border: 0; color: var(--ink-3);
  width: 22px; height: 22px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 100ms ease, color 100ms ease;
  flex-shrink: 0;
}
.nsd-site-group__toggle:hover { background: var(--bg-hover); color: var(--ink); }
.nsd-site-group__title-block { flex: 1; min-width: 0; }
.nsd-site-group__title-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nsd-site-group__name { font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }
.nsd-site-group__desc { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; max-width: 540px; }
.nsd-site-group__stats {
  display: flex; gap: 22px; padding: 0 18px;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.nsd-site-group__gw {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  flex-shrink: 0; text-align: left;
  white-space: nowrap;
}
.nsd-site-group__gw > div { display: flex; flex-direction: column; line-height: 1.2; }
.nsd-site-group__gw:hover { border-color: var(--accent); background: var(--accent-soft); }
.nsd-site-group__gw-arrow { color: var(--ink-4); }

.nsd-stat2 { text-align: left; }
.nsd-stat2__label { font-size: 10.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; white-space: nowrap; }
.nsd-stat2__value { font-size: 17px; font-weight: 600; color: var(--ink); margin-top: 2px; letter-spacing: -0.01em; }

/* ---------- Group icon ---------- */
.nsd-group-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.nsd-group-icon--lg { width: 44px; height: 44px; border-radius: 11px; }

/* NSN nodes strip inside site group */
.nsd-nodes-strip {
  padding: 12px 16px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-nodes-strip__title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600; margin-bottom: 8px;
}
.nsd-nodes-strip__list { display: flex; gap: 8px; flex-wrap: wrap; }
.nsd-node-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 6px 10px;
  font-size: 12px;
}
.nsd-node-chip__name { font-weight: 600; font-size: 12.5px; }
.nsd-node-chip__meta { font-size: 10.5px; color: var(--ink-3); }

/* ---------- Topology toolbar (above SVG) ---------- */
.nsd-topo-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ---------- Edge tooltip on topology ---------- */
.nsd-topo-edge-tooltip {
  position: fixed; z-index: 70;
  background: var(--ink); color: var(--bg-elev);
  padding: 8px 10px; border-radius: 6px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  min-width: 200px;
}
.nsd-topo-edge-tooltip .nsd-stack-row span { color: rgba(255,255,255,0.6) !important; }
.nsd-topo-edge-tooltip .mono { color: rgba(255,255,255,0.95) !important; }

/* ---------- ACL Tester (panel after topology) ---------- */
.nsd-acl-tester {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.nsd-acl-tester__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-acl-tester__body {
  display: grid; grid-template-columns: 1fr 32px 1fr auto;
  gap: 14px; align-items: end;
  padding: 14px 16px;
}
.nsd-acl-tester__col { display: flex; flex-direction: column; gap: 5px; }
.nsd-acl-tester__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; }
.nsd-acl-tester__arrow { display: flex; align-items: center; justify-content: center; padding-bottom: 8px; }
.nsd-acl-tester__result { display: flex; align-items: center; }
.nsd-acl-tester__pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: var(--radius-md);
  font-weight: 500;
}
.nsd-acl-tester__pill--allow { background: var(--success-soft); color: var(--success); }
.nsd-acl-tester__pill--deny  { background: var(--danger-soft);  color: var(--danger); }

/* ---------- ACL page redesign ---------- */
.nsd-acl-stat-row {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.nsd-acl-stat {
  flex: 1; min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--border-subtle);
}
}
.nsd-acl-stat:last-child { border-right: 0; }
.nsd-acl-stat__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600;
}
.nsd-acl-stat__value {
  margin-top: 4px;
  font-size: 22px; font-weight: 600; letter-spacing: -0.018em; line-height: 1;
}

.nsd-acl-toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 12px;
}
.nsd-acl-toolbar .nsd-input { width: 320px; }

.nsd-acl-table tbody tr { cursor: pointer; }
.nsd-acl-table /* ---------- ACL Subject / Resource pill (table cell) ---------- */
.nsd-subject-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 12px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.nsd-subject-pill__label { font-weight: 600; }
.nsd-subject-pill__count {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; min-width: 22px; padding: 0 6px;
  background: rgba(0,0,0,0.08); border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.nsd-subject-pill__tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  opacity: 0.7;
}
.nsd-subject-pill--user {
  background: var(--bg-active); color: var(--ink-2); border-color: var(--border);
}
.nsd-subject-pill--group {
  background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}
.nsd-subject-pill--group .nsd-subject-pill__count { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.nsd-subject-pill--system {
  background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, var(--border));
}
.nsd-subject-pill--system .nsd-subject-pill__count { background: color-mix(in srgb, var(--info) 20%, transparent); }
.nsd-subject-pill--all {
  background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, var(--border));
}
.nsd-subject-pill--service {
  background: var(--bg-active); color: var(--ink-2); border-color: var(--border);
}

/* Policy editor drawer */
.nsd-policy-form { display: flex; flex-direction: column; gap: 18px; }
.nsd-policy-form__section { display: flex; flex-direction: column; gap: 10px; }
.nsd-policy-form__section-title {
  display: inline-flex; gap: 6px; align-items: center;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); font-weight: 600;
}
.nsd-policy-form__footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Condition toggle (collapsible row) */
.nsd-cond {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 120ms ease, background 120ms ease;
}
.nsd-cond:not(:first-child) { margin-top: 8px; }
.nsd-cond.is-on { border-color: var(--accent); background: var(--accent-soft); }
.nsd-cond__head {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  background: transparent; border: 0; width: 100%;
  cursor: pointer; text-align: left;
}
.nsd-cond__label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.nsd-cond__hint { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.nsd-cond__body { padding: 0 12px 12px; }

/* ---------- Bulk service picker (in ACL editor) ---------- */
.nsd-bulk-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.nsd-bulk-picker__head {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-bulk-picker__list {
  max-height: 260px; overflow-y: auto;
}
.nsd-bulk-picker__row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 100ms ease;
}
.nsd-bulk-picker__row:last-child { border-bottom: 0; }
.nsd-bulk-picker__row:hover { background: var(--bg-hover); }
.nsd-bulk-picker__row.is-on { background: var(--accent-soft); }
.nsd-bulk-picker__row input { accent-color: var(--accent); }
.nsd-bulk-picker__foot {
  padding: 8px 12px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px; color: var(--ink-2);
}

/* ---------- Audit log filter panel ---------- */
.nsd-audit-filters {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.nsd-audit-filters__col { display: flex; flex-direction: column; gap: 6px; }
.nsd-audit-filters__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600;
}

/* ---------- Services grid view ---------- */
.nsd-svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.nsd-svc-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  cursor: pointer; text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  min-height: 110px;
}
.nsd-svc-card:hover { border-color: var(--border-strong); }
.nsd-svc-card__top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.nsd-svc-card__name { margin-top: 8px; font-size: 14px; font-weight: 600; letter-spacing: -0.012em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsd-svc-card__domain { font-size: 11px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsd-svc-card__bot {
  margin-top: auto; padding-top: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-3);
}
.nsd-svc-card__gw { display: inline-flex; gap: 4px; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nsd-svc-card__gw .mono { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.nsd-svc-card__metric { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; flex-shrink: 0; }
.nsd-svc-card__metric small { font-size: 9.5px; color: var(--ink-4); }

/* ---------- Service group header ---------- */
.nsd-svc-group-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}
.nsd-svc-group-head__name { font-weight: 600; font-size: 14px; color: var(--ink); }
.nsd-svc-group-head__meta { font-size: 11.5px; color: var(--ink-3); margin-left: 6px; }

/* ---------- Filter chips ---------- */
.nsd-chip {
  display: inline-flex; align-items: center;
  padding: 0 10px; height: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.nsd-chip:hover { border-color: var(--border-strong); color: var(--ink); }
.nsd-chip.is-active { background: var(--ink); color: var(--bg-elev); border-color: var(--ink); }

/* ---------- Column-toggle popover ---------- */
.nsd-col-toggle {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px;
  background: transparent; border: 0; cursor: pointer;
  border-radius: 6px;
  width: 100%; text-align: left;
}
.nsd-col-toggle:hover { background: var(--bg-hover); }

/* Checkbox row (transport selection in install wizard) */
.nsd-checkbox-row {
  display: inline-flex; gap: 8px; align-items: flex-start;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  min-width: 180px;
}
.nsd-checkbox-row:hover { border-color: var(--border-strong); }
.nsd-checkbox-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nsd-checkbox-row input { margin-top: 2px; accent-color: var(--accent); }

/* Site icon */
.nsd-site-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; box-shadow: 0 1px 2px rgba(79,70,229,0.3);
}
.nsd-site-icon--lg { width: 40px; height: 40px; border-radius: 10px; }

/* Gateway picker (in dialog) */
.nsd-gw-picker {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.nsd-gw-pick {
  display: block; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: border-color 120ms ease, background 120ms ease;
  background: var(--surface);
}
.nsd-gw-pick:hover { border-color: var(--accent); }
.nsd-gw-pick input { margin-right: 4px; }
.nsd-gw-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nsd-gw-pick__title { font-size: 13px; font-weight: 500; }
.nsd-gw-pick__meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* Stat */
.nsd-stat {
  padding: 10px 12px; background: var(--bg-sunken);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
}

.nsd-stat-card { padding: 14px 16px; }
.nsd-stat-card__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600;
}
.nsd-stat-card__value {
  margin-top: 4px;
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1;
  display: flex; align-items: baseline; gap: 4px;
}

/* ---------- Detail layout ---------- */
.nsd-detail-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}
.nsd-meta-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px;
  font-size: 13px;
}
.nsd-meta-list dt { color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.nsd-meta-list dd { margin: 0; color: var(--ink); font-size: 13px; margin-top: 2px; }
.nsd-meta-list dd.mono { font-size: 12px; }

/* ---------- Service detail ---------- */
.nsd-svc-path {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.nsd-svc-hop {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 12px;
}
.nsd-svc-hop__icon { color: var(--accent); }
.nsd-svc-arrow {
  flex: 0 0 auto; position: relative; height: 1px; background: var(--border);
  flex-grow: 1; min-width: 24px;
}
.nsd-svc-arrow::after {
  content: ""; position: absolute; right: -4px; top: -3px;
  border-left: 5px solid var(--border); border-top: 3px solid transparent; border-bottom: 3px solid transparent;
}

/* ---------- ACL policy editor ---------- */
.nsd-rule-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
}
.nsd-rule-card__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.nsd-rule-flow {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch;
}
.nsd-rule-tile {
  background: var(--bg-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 10px 12px;
  min-width: 0;
}
.nsd-rule-tile__kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; }
.nsd-rule-tile__val { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 4px; }
.nsd-rule-tile__meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.nsd-rule-arrow {
  position: relative; display: flex; align-items: center; justify-content: center;
}
.nsd-rule-arrow__line { width: 100%; height: 1px; background: var(--success); }
.nsd-rule-arrow__chip {
  position: absolute; background: var(--success-soft); color: var(--success);
  font-weight: 600; font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border));
}

/* ---------- Auth key install command card ---------- */
.nsd-install-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.nsd-install-card__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  background: var(--ink);
  color: var(--bg-elev);
}
.nsd-install-card__head .mono { font-size: 12px; opacity: 0.8; }

/* ---------- Settings layout ---------- */
.nsd-settings { display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.nsd-settings__nav { display: flex; flex-direction: column; gap: 2px; }
.nsd-settings__nav button {
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 8px 10px; background: transparent; border: 0;
  border-radius: var(--radius-md); cursor: pointer;
  font-size: 13px; color: var(--ink-2);
  border-left: 2px solid transparent; margin-left: -2px;
}
.nsd-settings__nav button:hover { color: var(--ink); background: var(--bg-hover); }
.nsd-settings__nav button.is-active { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Portal ---------- */
.nsd-portal-hero {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #174A98 0%, #2E78D1 100%);
  color: white; overflow: hidden;
}
.nsd-portal-hero__deco {
  position: absolute; top: -40px; right: -40px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,0.1); opacity: 0.5;
}

/* ---------- Tag editor / multi-tag ---------- */
.nsd-tags-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- JSON view ---------- */
.nsd-json {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--bg-sunken); border-radius: var(--radius-md);
  padding: 14px 16px;
  line-height: 1.6; overflow-x: auto;
  color: var(--ink-2);
  border: 1px solid var(--border-subtle);
}
.nsd-json .k { color: var(--accent); }
.nsd-json .s { color: var(--success); }
.nsd-json .n { color: var(--chart-5); }
.nsd-json .b { color: var(--accent-2); }
.nsd-json .p { color: var(--ink-4); }

/* ---------- Topology page ---------- */
.nsd-topo-page { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; overflow: hidden; }
.nsd-topo-page__svg { width: 100%; height: 580px; display: block; background:
  radial-gradient(circle at 20px 20px, var(--border-subtle) 1px, transparent 1px) 0 0 / 22px 22px;
}
.nsd-topo-node rect { transition: stroke 120ms ease, filter 120ms ease; }
.nsd-topo-node:hover rect { stroke: var(--accent); filter: drop-shadow(0 2px 4px rgba(79,70,229,0.18)); }
.nsd-topo-legend-floating {
  position: absolute; bottom: 14px; right: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px; min-width: 200px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 5px;
}
.nsd-topo-legend-floating__title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); font-weight: 600; margin-bottom: 4px;
}
.nsd-topo-detail-card {
  position: absolute; bottom: 14px; left: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px; min-width: 280px;
  box-shadow: var(--shadow-md);
}
.nsd-topo-detail__head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.nsd-topo-detail__name { font-weight: 600; font-size: 14px; }

/* ---------- Stack pieces ---------- */
.nsd-stack-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}
.nsd-stack-row:first-child { border-top: 0; }

/* Portal hero (slim) */
.nsd-portal-hero-slim {
  display: flex; justify-content: space-between; gap: 24px; align-items: flex-end;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-portal-status-compact {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 12px;
  background: var(--bg-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.nsd-portal-status-compact .nsd-live-pulse__dot { background: var(--success); }

/* Onboarding banner */
.nsd-portal-onboarding {
  margin-bottom: 24px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}

/* Services section */
.nsd-portal-svc-section { display: flex; flex-direction: column; gap: 14px; }
.nsd-portal-svc-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.nsd-portal-grid-dense {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.nsd-portal-svc-dense {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.nsd-portal-svc-dense:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.nsd-portal-svc-dense__top { display: flex; justify-content: space-between; gap: 6px; }
.nsd-portal-svc-dense__name { margin-top: 8px; font-size: 14px; font-weight: 600; letter-spacing: -0.012em; }
.nsd-portal-svc-dense__domain { font-size: 11px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsd-portal-svc-dense__bot {
  margin-top: 12px; display: flex; justify-content: space-between; gap: 6px;
}

/* Pagination */
.nsd-portal-pagination {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  margin-top: 8px;
}

/* Devices panel (collapsed) */
.nsd-portal-devices {}
.nsd-portal-devices__head {
  display: flex; gap: 10px; align-items: center;
  width: 100%; padding: 12px 16px;
  background: transparent; border: 0; cursor: pointer;
  text-align: left;
}
.nsd-portal-devices__head:hover { background: var(--bg-hover); }
.nsd-portal-devices__row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.nsd-portal-devices__row:last-child { border-bottom: 0; }

/* Portal downloads grid */
.nsd-portal-downloads {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.nsd-portal-dl {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  text-align: left;
}
.nsd-portal-dl:hover:not(.is-disabled) { border-color: var(--accent); background: var(--bg-hover); }
.nsd-portal-dl.is-primary {
  background: var(--ink); color: var(--bg-elev); border-color: var(--ink);
}
.nsd-portal-dl.is-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.nsd-portal-dl.is-disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Pulse for live indicator ---------- */
.nsd-live-pulse { display: inline-flex; gap: 6px; align-items: center; }
.nsd-live-pulse__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  position: relative;
}
.nsd-live-pulse__dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--success); animation: ns-pulse-soft 1.4s ease-in-out infinite;
}

/* ---------- Quick Start ---------- */
.nsd-qs-keybanner {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 18px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface);
}
.nsd-qs-keybanner--ok { border-color: color-mix(in srgb, var(--success) 38%, var(--border)); background: var(--success-soft); }
.nsd-qs-keybanner__ic {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--success); color: #fff;
}
.nsd-qs-keybanner__ic--muted { background: var(--accent-soft); color: var(--accent); }
.nsd-qs-keybanner__body { flex: 1; min-width: 0; }
.nsd-qs-keybanner__title { font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nsd-qs-keybanner__name { font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--bg-active); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.nsd-qs-keybanner__tokenrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.nsd-qs-keybanner__token {
  font-size: 12.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px;
  max-width: 100%; overflow-x: auto; white-space: nowrap;
}
.nsd-qs-keybanner__copy {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 11px; cursor: pointer; transition: border-color 120ms;
}
.nsd-qs-keybanner__copy:hover { border-color: var(--border-strong); }
.nsd-qs-keybanner__hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.55; margin-top: 8px; }
.nsd-qs-keybanner__cta {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 12.5px; font-weight: 600; color: #fff;
  background: var(--accent); border: 0; border-radius: 7px;
  padding: 8px 14px; cursor: pointer; align-self: center;
}
.nsd-qs-keybanner__cta:hover { background: var(--accent-2); }
.nsd-qs-keybanner__close {
  flex-shrink: 0; width: 26px; height: 26px; border: 0; background: transparent;
  color: var(--ink-4); border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nsd-qs-keybanner__close:hover { background: rgba(0,0,0,0.06); color: var(--ink-2); }

.nsd-qs-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .nsd-qs-roles { grid-template-columns: 1fr; } }
.nsd-qs-role {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); cursor: pointer; transition: border-color 120ms, background 120ms, box-shadow 120ms;
}
.nsd-qs-role:hover { border-color: var(--border-strong); }
.nsd-qs-role.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.nsd-qs-role__icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-active); color: var(--ink-2);
}
.nsd-qs-role.is-active .nsd-qs-role__icon { background: var(--accent); color: #fff; }
.nsd-qs-role__text { min-width: 0; }
.nsd-qs-role__label { font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); line-height: 1.3; }
.nsd-qs-role__desc { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }

.nsd-qs-platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .nsd-qs-platforms { grid-template-columns: 1fr; } }
.nsd-qs-plat {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; color: var(--ink-2);
  transition: border-color 120ms, background 120ms;
}
.nsd-qs-plat:hover { border-color: var(--border-strong); }
.nsd-qs-plat.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent) inset; }
.nsd-qs-plat__ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.nsd-qs-plat__ico--macos   { background: #1118270f; color: #111827; }
.nsd-qs-plat__ico--windows { background: #2e78d119; color: #2E78D1; }
.nsd-qs-plat__ico--linux   { background: #f59e0b1f; color: #E8870B; }
[data-theme="dark"] .nsd-qs-plat__ico--macos { background: #ffffff1a; color: #e5e7eb; }
.nsd-qs-plat__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; }
.nsd-qs-plat__label { font-size: 13px; font-weight: 600; line-height: 1.2; }
.nsd-qs-plat__meta { font-size: 10.5px; color: var(--ink-3); line-height: 1.2; white-space: nowrap; }
.nsd-qs-plat.is-active .nsd-qs-plat__meta { color: var(--accent-ink); }

.nsd-qs-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-md);
  background: var(--info-soft); color: var(--info);
  font-size: 12.5px; line-height: 1.55;
}
.nsd-qs-note svg { flex-shrink: 0; margin-top: 1px; }

.nsd-qs-steps { position: relative; }
.nsd-qs-step { display: flex; gap: 16px; }
.nsd-qs-step__rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.nsd-qs-step__num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
}
.nsd-qs-step:not(.is-last) .nsd-qs-step__rail::after {
  content: ""; flex: 1; width: 2px; background: var(--border); margin: 6px 0; min-height: 16px;
}
.nsd-qs-step__body { flex: 1; padding-bottom: 22px; min-width: 0; }
.nsd-qs-step.is-last .nsd-qs-step__body { padding-bottom: 0; }
.nsd-qs-step__title { font-size: 14px; font-weight: 600; color: var(--ink); padding-top: 4px; }
.nsd-qs-step__content { margin-top: 8px; }
.nsd-qs-p { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin: 0 0 10px; }
.nsd-qs-fineprint { font-size: 11px; color: var(--ink-4); align-self: center; }
.nsd-qs-field-demo {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink-3); margin-top: 4px;
}
.nsd-qs-field-demo .mono { font-size: 12px; color: var(--ink-2); }
.nsd-qs-field-demo__cta {
  margin-left: 6px; padding: 3px 12px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600;
}

.nsd-qs-docs {
  display: flex; gap: 9px; align-items: center; margin-top: 18px;
  padding: 13px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  font-size: 12.5px; color: var(--ink-3);
}
.nsd-qs-docs svg { flex-shrink: 0; color: var(--ink-4); }
.nsd-qs-docs__link { color: var(--accent); cursor: pointer; font-weight: 500; }
.nsd-qs-docs__link:hover { text-decoration: underline; }
