/* =============================================================
   DO NOT EDIT — built from src/, run build.sh to regenerate
   Built: 2026-05-30 13:39:25 UTC
   Source files (cascade order):
     01-tokens.css
     02-prose.css
     03-ui.css
     04-auth.css
   ============================================================= */


/* ── 01-tokens.css ── */
/* =====================================================================
   01-tokens.css — NeuralSafe design-system token foundation
   Source: ns-styles.css (adapted) + custom.css §1–§3 (LibreChat bridge)
   ─────────────────────────────────────────────────────────────────────
   Selector note: uses both .dark (LibreChat) and [data-theme="dark"]
   (reference HTML mockup) so both rendering contexts work from the
   same file. In LibreChat, html.dark comes from our injected script.
   ===================================================================== */

/* ── Geist webfont ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;450;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ── Global typography ─────────────────────────────────────────────── */
:root, html {
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
code, pre, kbd, samp, .font-mono {
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace !important;
}
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv01", "ss01";
}

/* ── Shared constants (both themes) ───────────────────────────────── */
:root {
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 7px; --r-md: 11px; --r-lg: 16px; --r-xl: 22px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* global corner radius (shadcn token) */
  --radius: 0.7rem;

  /* ── NeuralSafe accent — light mode ── */
  --ns-accent:        #14857f;
  --ns-accent-strong: #0f7670;
  --ns-accent-ink:    #ffffff;
  --ns-sovereign:     var(--ns-accent);
  --ns-cloud:         #c0623a;

  /* Design-system alias (used by ns-ui/ns-auth CSS) */
  --accent:           var(--ns-accent);
  --accent-strong:    var(--ns-accent-strong);
  --accent-ink:       var(--ns-accent-ink);
  --sovereign:        var(--ns-sovereign);
  --cloud:            var(--ns-cloud);

  /* ── LibreChat token bridge — light mode ── */
  --surface-primary:   oklch(0.992 0.001 256);
  --surface-secondary: oklch(0.976 0.002 256);
  --surface-tertiary:  oklch(0.958 0.003 256);
  --surface-hover:     oklch(0.958 0.003 256);
  --surface-active:    oklch(0.935 0.004 256);
  --surface-chat:      oklch(0.992 0.001 256);
  --surface-dialog:    oklch(0.992 0.001 256);

  --text-primary:      oklch(0.235 0.008 256);
  --text-secondary:    oklch(0.46 0.008 256);
  --text-tertiary:     oklch(0.62 0.008 256);

  --border-light:      oklch(0.925 0.003 256);
  --border-medium:     oklch(0.90 0.004 256);
  --border-heavy:      oklch(0.82 0.006 256);

  /* ── Design-system internal aliases → LibreChat tokens ── */
  --bg:            var(--surface-primary);
  --bg-elevated:   var(--surface-secondary);
  --surface:       var(--surface-tertiary);
  --surface-hi:    var(--surface-active);
  --border-soft:   var(--border-light);
  --border-strong: var(--border-heavy);
  --text:          var(--text-primary);
  --text-muted:    var(--text-secondary);
  --text-faint:    var(--text-tertiary);

  /* shadcn HSL tokens */
  --primary: 184 70% 31%;
  --ring:    184 70% 31%;

  /* LibreChat submit/focus tokens → teal */
  --brand-purple:         var(--ns-accent);
  --surface-submit:       var(--ns-accent);
  --surface-submit-hover: var(--ns-accent-strong);
  --ring-primary:         var(--ns-accent);

  /* Light shadow */
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px -14px rgba(20,30,40,.18);
  --accent-wash:  color-mix(in oklab, var(--accent) 9%, transparent);
  --cloud-wash:   color-mix(in oklab, var(--cloud) 10%, transparent);
}

/* ── Dark mode ─────────────────────────────────────────────────────── */
/* .dark      = LibreChat's runtime class on <html>                     */
/* [data-theme="dark"] = reference HTML mockup (ns-app.jsx)             */
.dark, [data-theme="dark"] {
  color-scheme: dark;

  /* ── NeuralSafe accent — dark mode ── */
  --ns-accent:        oklch(0.74 0.095 196);   /* ≈ #2bb3ab */
  --ns-accent-strong: oklch(0.80 0.10 196);    /* ≈ #46c4bc */
  --ns-accent-ink:    oklch(0.17 0.03 200);    /* ≈ #06201f */
  --ns-cloud:         oklch(0.76 0.12 40);     /* ≈ #ef8a63 */
  --ns-sovereign:     var(--ns-accent);

  --accent:           var(--ns-accent);
  --accent-strong:    var(--ns-accent-strong);
  --accent-ink:       var(--ns-accent-ink);
  --sovereign:        var(--ns-sovereign);
  --cloud:            var(--ns-cloud);

  /* ── LibreChat token bridge — dark mode ── */
  --surface-primary:   oklch(0.169 0.004 256);
  --surface-secondary: oklch(0.199 0.005 256);
  --surface-tertiary:  oklch(0.232 0.006 256);
  --surface-hover:     oklch(0.232 0.006 256);
  --surface-active:    oklch(0.268 0.007 256);
  --surface-chat:      oklch(0.169 0.004 256);
  --surface-dialog:    oklch(0.199 0.005 256);

  --text-primary:      oklch(0.965 0.003 256);
  --text-secondary:    oklch(0.72 0.006 256);
  --text-tertiary:     oklch(0.55 0.007 256);

  --border-light:      oklch(0.255 0.006 256);
  --border-medium:     oklch(0.30 0.007 256);
  --border-heavy:      oklch(0.40 0.009 256);

  /* shadcn HSL tokens — teal */
  --primary: 176 60% 44%;
  --ring:    176 60% 44%;

  /* Dark shadow */
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px -12px rgba(0,0,0,.55);
  --accent-wash:  color-mix(in oklab, var(--accent) 12%, transparent);
  --cloud-wash:   color-mix(in oklab, var(--cloud) 13%, transparent);
}

/* Light mode also addressed via [data-theme="light"] for the mockup */
:root, [data-theme="light"] {
  color-scheme: light;
}

/* ── Remaining html.dark LibreChat-specific variable overrides ─────── */
/* These use html.dark (type+class, specificity 0,1,1) to override      */
/* LibreChat's .dark block for tokens the design system doesn't cover.  */
html.dark {
  --background:            0 0% 0%;
  --card:                  0 0% 2%;
  --popover:               0 0% 2%;
  --foreground:            0 0% 98%;
  --card-foreground:       0 0% 98%;
  --popover-foreground:    0 0% 98%;
  --primary-foreground:    0 0% 100%;
  --accent:                176 60% 44%;   /* teal HSL for shadcn --accent */
  --accent-foreground:     0 0% 100%;
  --secondary:             0 0% 6%;
  --secondary-foreground:  0 0% 90%;
  --muted:                 0 0% 9%;
  --muted-foreground:      0 0% 60%;
  --border:                0 0% 14%;
  --input:                 0 0% 9%;

  --sidebar:                    0 0% 2%;
  --sidebar-background:         0 0% 2%;
  --sidebar-foreground:         0 0% 90%;
  --sidebar-primary:            176 60% 44%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent:             176 60% 15%;
  --sidebar-accent-foreground:  0 0% 100%;
  --sidebar-border:             0 0% 10%;
  --sidebar-ring:               176 60% 44%;
}

/* ── Animations ────────────────────────────────────────────────────── */
@keyframes ns-rise { from { transform: translateY(8px); } to { transform: none; } }
@keyframes ns-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ns-blink { 0%,80%,100%{ opacity:.25 } 40%{ opacity:1 } }
.ns-rise { animation: ns-rise .5s var(--ease) both; }
.ns-fade { animation: ns-fade .35s var(--ease) forwards; }
.ns-dot  { animation: ns-blink 1.3s infinite both; }

/* ── Selection ─────────────────────────────────────────────────────── */
::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); }

/* ── Scrollbars ────────────────────────────────────────────────────── */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-heavy); border-radius: 99px;
  border: 3px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint); background-clip: padding-box;
}
*::-webkit-scrollbar-track { background: transparent; }

/* ── Focus rings ───────────────────────────────────────────────────── */
.ns-focusable:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent) 60%, transparent);
  outline-offset: 2px;
}
/* LibreChat global focus ring */
html.dark *:focus-visible {
  outline-color: var(--ns-accent) !important;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ns-accent) 20%, transparent) !important;
}

/* ── Active/selected Tailwind states ───────────────────────────────── */
html.dark [class*="bg-token-surface-tertiary"],
html.dark [aria-selected="true"],
html.dark [data-active="true"],
html.dark [class*="bg-gray-200"],
html.dark [class*="dark:bg-gray-700"],
html.dark [class*="dark:bg-gray-600"] {
  background-color: var(--surface-active) !important;
}


/* ── 02-prose.css ── */
/* =====================================================================
   02-prose.css — assistant rich content: prose, code, tables
   Source: ns-prose.css (design ref) + LibreChat .prose class overrides
   ─────────────────────────────────────────────────────────────────────
   .ns-p / .ns-code / .ns-table — activated by custom.js DOM patches
   .prose / .prose pre / .prose table — LibreChat's own markdown class
   ===================================================================== */

/* ── LibreChat .prose overrides ────────────────────────────────────── */
.prose { max-width: 768px; line-height: 1.72; }
.prose pre {
  border: 1px solid var(--border-medium);
  border-radius: var(--r-md, 11px);
}
.prose :not(pre) > code {
  background: var(--surface-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px; padding: 1px 6px; font-size: .86em;
}
.prose table {
  border: 1px solid var(--border-medium); border-radius: var(--r-md, 11px);
  border-collapse: separate; border-spacing: 0; overflow: hidden;
}
.prose thead th {
  background: var(--surface-tertiary); text-transform: uppercase;
  letter-spacing: .04em; font-size: .72em; color: var(--text-secondary);
}

/* ── Design-system .ns-* prose elements (for custom.js injected content) ── */
.ns-p { margin: 0 0 14px; line-height: 1.72; font-size: 15.5px; color: var(--text);
        letter-spacing: -0.005em; }
.ns-p:last-child { margin-bottom: 0; }
.ns-p em, .ns-list em { font-style: italic; color: var(--text-muted); }

.ns-h { margin: 22px 0 11px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
        color: var(--text); }
.ns-h:first-child { margin-top: 0; }

.ns-list { margin: 0 0 14px; padding-left: 20px; line-height: 1.7; font-size: 15.5px; }
.ns-list li { margin: 5px 0; padding-left: 4px; }
.ns-ul li::marker { color: var(--text-faint); }
.ns-ol li::marker { color: var(--text-faint); font-variant-numeric: tabular-nums; }

.ns-icode {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--surface); border: 1px solid var(--border-soft);
  padding: 1px 6px; border-radius: 6px; color: var(--text); letter-spacing: 0;
}

/* Code block */
.ns-code {
  margin: 4px 0 16px; border: 1px solid var(--border-medium);
  border-radius: var(--r-md); overflow: hidden; background: var(--bg-elevated);
}
.ns-code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px 7px 14px; border-bottom: 1px solid var(--border-soft);
  background: color-mix(in oklab, var(--surface) 50%, transparent);
}
.ns-code-lang {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint);
}
.ns-code-copy {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text-faint);
  font-size: 12px; padding: 3px 7px; border-radius: 6px; transition: .18s var(--ease);
  font-family: var(--font-sans);
}
.ns-code-copy:hover { color: var(--text); background: var(--surface); }
.ns-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.ns-code code {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.65;
  color: var(--text); letter-spacing: 0;
}
.t-kw  { color: var(--accent-strong); font-weight: 500; }
.t-str { color: var(--cloud); }
.t-cm  { color: var(--text-faint); font-style: italic; }

/* Table */
.ns-table-wrap { margin: 4px 0 16px; }
.ns-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border-medium); border-radius: var(--r-md); overflow: hidden;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.ns-table th {
  text-align: left; font-weight: 550; color: var(--text-muted);
  font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 10px 14px;
  background: color-mix(in oklab, var(--surface) 55%, transparent);
  border-bottom: 1px solid var(--border-medium);
}
.ns-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-soft); color: var(--text);
}
.ns-table tr:last-child td { border-bottom: none; }
.ns-table tbody tr { transition: background .15s var(--ease); }
.ns-table tbody tr:hover { background: color-mix(in oklab, var(--surface) 40%, transparent); }
.ns-table td:nth-child(3) { font-variant-numeric: tabular-nums; }

.ns-ok   { color: var(--accent-strong); font-weight: 500; }
.ns-bad  { color: var(--cloud); font-weight: 500; }
.ns-flag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--cloud); background: var(--cloud-wash);
  border: 1px solid color-mix(in oklab, var(--cloud) 35%, transparent);
  padding: 1px 7px; border-radius: 99px;
}
.ns-table-note {
  margin-top: 10px; font-size: 13.5px; line-height: 1.6; color: var(--text-muted);
  padding-left: 12px; border-left: 2px solid var(--border-strong);
}


/* ── 03-ui.css ── */
/* =====================================================================
   03-ui.css — app shell, sidebar, topbar, thread, badges, composer
   Source: ns-ui.css (design ref, activated by custom.js)
   ─────────────────────────────────────────────────────────────────────
   .ns-* classes: styled here, injected into LibreChat DOM by custom.js.
   LibreChat's own selectors are also patched here where CSS can reach.
   ===================================================================== */

/* ── App shell ─────────────────────────────────────────────────────── */
.ns-app { display: flex; height: 100%; background: var(--bg); }
.ns-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Route dots ────────────────────────────────────────────────────── */
.ns-route-dot {
  width: 7px; height: 7px; border-radius: 99px;
  flex-shrink: 0; display: inline-block;
}
.ns-route-dot.sovereign,
.ns-route-dot[data-route="sovereign"] {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.ns-route-dot.cloud,
.ns-route-dot[data-route="cloud"] {
  background: var(--cloud);
  box-shadow: 0 0 0 3px var(--cloud-wash);
}

/* ── Icon button ───────────────────────────────────────────────────── */
.ns-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
  color: var(--text-muted); transition: .16s var(--ease);
}
.ns-icon-btn:hover { background: var(--surface); color: var(--text); }

/* ── Sidebar ───────────────────────────────────────────────────────── */
.ns-sidebar {
  width: 288px; flex-shrink: 0; background: var(--bg-elevated);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  transition: width .28s var(--ease), margin .28s var(--ease);
}
.ns-sidebar.collapsed { margin-left: -288px; }
.ns-sb-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px 18px;
}
.ns-sb-actions { padding: 4px 12px 8px; }
.ns-newchat {
  width: 100%; display: flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  transition: .16s var(--ease); font-family: var(--font-sans);
}
.ns-newchat:hover { background: var(--surface-hi); border-color: var(--border-strong); }
.ns-search {
  display: flex; align-items: center; gap: 8px; margin: 4px 12px 6px;
  padding: 8px 11px; border-radius: var(--r-md); background: var(--bg);
  border: 1px solid var(--border-soft);
}
.ns-search input {
  flex: 1; border: none; background: none; color: var(--text); font-size: 13.5px;
  outline: none; font-family: var(--font-sans);
}
.ns-search input::placeholder { color: var(--text-faint); }
.ns-history { flex: 1; overflow-y: auto; padding: 8px 8px 12px; }
.ns-hist-group { margin-bottom: 14px; }
.ns-hist-label {
  font-size: 11px; font-weight: 550; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-faint); padding: 6px 10px 4px;
}
.ns-hist-item {
  width: 100%; text-align: left; display: block; padding: 8px 10px; border-radius: 8px;
  border: none; background: transparent; color: var(--text-muted); font-size: 13.5px;
  transition: .14s var(--ease); position: relative; font-family: var(--font-sans);
}
.ns-hist-item:hover { background: var(--surface); color: var(--text); }
.ns-hist-item.active { background: var(--surface); color: var(--text); }
.ns-hist-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2.5px;
  border-radius: 99px; background: var(--accent);
}
.ns-hist-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-hist-empty { padding: 14px 12px; color: var(--text-faint); font-size: 13px; }
.ns-sb-bottom { border-top: 1px solid var(--border-soft); padding: 10px; }

/* ── Model picker ──────────────────────────────────────────────────── */
.ns-model { position: relative; margin-bottom: 8px; }
.ns-model-btn {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: .16s var(--ease); font-family: var(--font-sans);
}
.ns-model-btn:hover { border-color: var(--border-strong); }
.ns-model-name { flex: 1; text-align: left; font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-model-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px; z-index: 30;
}
.ns-model-opt {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: none; background: transparent; border-radius: 9px; text-align: left;
  transition: .14s var(--ease); font-family: var(--font-sans);
}
.ns-model-opt:hover { background: var(--surface); }
.ns-model-opt.sel { background: var(--surface); }
.ns-model-opt-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ns-model-opt-name { font-size: 13px; font-weight: 500; color: var(--text); }
.ns-model-opt-desc { font-size: 11.5px; color: var(--text-faint); }
.ns-model-foot {
  display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 9px 10px 4px;
  border-top: 1px solid var(--border-soft); font-size: 11px; color: var(--text-faint);
}

/* ── Identity / user avatar ────────────────────────────────────────── */
.ns-identity {}
.ns-id-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 9px;
  border: none; background: transparent; border-radius: var(--r-md);
  transition: .14s var(--ease); font-family: var(--font-sans);
}
.ns-id-btn:hover { background: var(--surface); }
.ns-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #000));
  color: var(--accent-ink); font-size: 12px; font-weight: 650; letter-spacing: 0.02em;
}
.ns-id-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; }
.ns-id-name { font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-id-mail { font-size: 11.5px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Topbar ────────────────────────────────────────────────────────── */
.ns-topbar {
  height: 56px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 16px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px);
}
.ns-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ns-topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ns-topbar-name { font-size: 14px; font-weight: 550; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-ghost-btn {
  font-size: 13px; color: var(--text-muted); background: transparent;
  border: 1px solid var(--border); padding: 7px 13px; border-radius: 8px;
  transition: .16s var(--ease); font-family: var(--font-sans);
}
.ns-ghost-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

/* ── Sovereign/cloud badge ─────────────────────────────────────────── */
.ns-badge {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  white-space: nowrap; font-size: 12px; font-weight: 550;
  padding: 3px 9px 3px 8px; border-radius: 99px; border: 1px solid transparent;
}
.ns-badge.sovereign,
.ns-badge[data-route="sovereign"] {
  color: var(--accent-strong); background: var(--accent-wash);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
}
.ns-badge.cloud,
.ns-badge[data-route="cloud"] {
  color: var(--cloud); background: var(--cloud-wash);
  border-color: color-mix(in oklab, var(--cloud) 32%, transparent);
}
.ns-badge.sm { font-size: 11px; padding: 2px 8px; }
.ns-badge-sep { width: 1px; height: 11px; background: currentColor; opacity: .3; }
.ns-badge-time { font-weight: 450; opacity: .82; font-variant-numeric: tabular-nums; }

/* ── Thread + messages ─────────────────────────────────────────────── */
.ns-thread { flex: 1; overflow-y: auto; }
.ns-thread-inner { max-width: 768px; margin: 0 auto; padding: 30px 28px 16px; }
.ns-row { margin-bottom: 30px; }
.ns-row.user { display: flex; justify-content: flex-end; }
.ns-bubble {
  max-width: 80%; background: var(--surface); border: 1px solid var(--border-soft);
  padding: 12px 16px; border-radius: var(--r-lg) var(--r-lg) 5px var(--r-lg);
  font-size: 15px; line-height: 1.6; color: var(--text); letter-spacing: -0.005em;
}
.ns-row.assistant { display: flex; gap: 15px; }
.ns-asst-mark {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border-soft); color: var(--accent);
}
.ns-asst-body { flex: 1; min-width: 0; }
.ns-asst-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.ns-asst-name { font-size: 13.5px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.ns-asst-content { color: var(--text); }
.ns-msg-actions {
  display: flex; gap: 2px; margin-top: 14px; opacity: 0;
  transition: opacity .2s var(--ease);
}
.ns-row.assistant:hover .ns-msg-actions { opacity: 1; }
.ns-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px; border: none;
  background: transparent; color: var(--text-faint); transition: .14s var(--ease);
}
.ns-act:hover { background: var(--surface); color: var(--text); }
.ns-typing { display: inline-flex; align-items: center; gap: 5px; padding: 6px 2px; }
.ns-typing .ns-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--text-faint); }

/* ── Empty state ───────────────────────────────────────────────────── */
.ns-empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ns-empty-inner { max-width: 640px; width: 100%; text-align: center; }
.ns-empty-mark {
  width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; color: var(--accent);
  background: var(--surface); border: 1px solid var(--border-soft);
}
.ns-empty-title { font-size: 30px; font-weight: 300; letter-spacing: -0.02em;
  margin: 0 0 12px; color: var(--text); }
.ns-empty-sub { font-size: 15px; line-height: 1.65; color: var(--text-muted);
  margin: 0 auto 34px; max-width: 460px; }
.ns-sov-text { color: var(--accent-strong); font-weight: 500; }
.ns-suggest { display: grid; grid-template-columns: 1fr; gap: 10px;
  text-align: left; max-width: 460px; margin: 0 auto; }
.ns-sg {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--bg-elevated); transition: .16s var(--ease);
  font-family: var(--font-sans);
}
.ns-sg:hover { border-color: var(--border-strong); background: var(--surface); transform: translateY(-1px); }
.ns-sg-icon { color: var(--accent); flex-shrink: 0; display: flex; }
.ns-sg-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.ns-sg-title { font-size: 14px; font-weight: 550; color: var(--text); }
.ns-sg-sub { font-size: 12.5px; color: var(--text-faint); line-height: 1.4; }

/* ── Composer ──────────────────────────────────────────────────────── */
.ns-composer-wrap { max-width: 768px; width: 100%; margin: 0 auto; padding: 8px 28px 18px; }
.ns-composer {
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background: var(--bg-elevated); box-shadow: var(--shadow);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease); overflow: hidden;
}
.ns-composer:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow), 0 0 0 3px var(--accent-wash);
}
.ns-input {
  width: 100%; border: none; background: none; resize: none; outline: none;
  color: var(--text); font-size: 15.5px; line-height: 1.6; padding: 16px 18px 4px;
  max-height: 220px; letter-spacing: -0.005em; font-family: var(--font-sans);
}
.ns-input::placeholder { color: var(--text-faint); }
.ns-composer-bar {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px;
}
.ns-composer-left { display: flex; align-items: center; gap: 4px; }
.ns-route-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 6px;
  white-space: nowrap; font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 99px;
}
.ns-route-pill.sovereign { color: var(--accent-strong); background: var(--accent-wash); }
.ns-route-pill.cloud { color: var(--cloud); background: var(--cloud-wash); }
.ns-send {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: var(--surface); color: var(--text-faint); transition: .18s var(--ease);
}
.ns-send.ready { background: var(--accent); color: var(--accent-ink); }
.ns-send.ready:hover { background: var(--accent-strong); }
.ns-send:disabled { cursor: default; }
.ns-composer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 6px 0; font-size: 11.5px; color: var(--text-faint);
}
.ns-composer-foot span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ns-foot-dim { opacity: .8; }
@media (max-width: 700px) { .ns-foot-dim { display: none; } }

/* ── Settings panel ────────────────────────────────────────────────── */
.ns-settings { position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center; padding: 28px; }
.ns-set-scrim { position: absolute; inset: 0;
  background: color-mix(in oklab, #000 52%, transparent);
  backdrop-filter: blur(3px); z-index: 0; }
.ns-set-panel {
  position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: 86vh;
  overflow: hidden; display: flex; flex-direction: column;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow);
}
.ns-set-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 16px 22px; border-bottom: 1px solid var(--border-soft);
}
.ns-set-head h2 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.ns-set-body { overflow-y: auto; padding: 8px 22px 22px; }
.ns-set-section { padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.ns-set-section:last-child { border-bottom: none; }
.ns-set-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 12px;
}
.ns-set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.ns-set-row-text { display: flex; flex-direction: column; gap: 2px; }
.ns-set-row-title { font-size: 14px; font-weight: 500; color: var(--text); }
.ns-set-row-sub { font-size: 12.5px; color: var(--text-faint); line-height: 1.4; }
.ns-seg {
  display: inline-flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 3px; gap: 2px; flex-shrink: 0;
}
.ns-seg-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border: none; background: transparent; color: var(--text-muted); font-size: 12.5px;
  font-weight: 500; border-radius: 6px; transition: .15s var(--ease);
  font-family: var(--font-sans);
}
.ns-seg-btn.on { background: var(--surface-hi); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.ns-switch {
  width: 40px; height: 23px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--surface); position: relative; transition: .18s var(--ease);
  flex-shrink: 0; padding: 0; cursor: pointer;
}
.ns-switch.on { background: var(--accent); border-color: var(--accent); }
.ns-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 99px;
  background: #fff; transition: .18s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.ns-switch.on .ns-switch-knob { left: 19px; }
.ns-set-card {
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: 4px 14px;
}
.ns-set-card-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; font-size: 13.5px;
  border-bottom: 1px solid var(--border-soft);
}
.ns-set-card-row:last-child { border-bottom: none; }
.ns-set-card-row > span:first-child { color: var(--text-muted); }
.ns-set-strong { color: var(--text); font-weight: 500; }

/* ── Hide LibreChat branding footer ────────────────────────────────── */
/* Chat/Footer.tsx renders [role="contentinfo"] containing a link to
   librechat.ai when config.customFooter is not set. This hides it
   without affecting any future privacy-policy / terms links we might
   add (those don't contain an href to librechat.ai). */
[role="contentinfo"]:has(a[href*="librechat.ai"]) {
  display: none !important;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .ns-sidebar { position: absolute; z-index: 40; height: 100%; box-shadow: var(--shadow); }
  .ns-thread-inner, .ns-composer-wrap { padding-left: 18px; padding-right: 18px; }
  .ns-bubble { max-width: 88%; }
}


/* ── 04-auth.css ── */
/* =====================================================================
   04-auth.css — login screen + settings panel auth overrides
   Source: ns-auth.css (design ref) + LibreChat login page restyle
   ─────────────────────────────────────────────────────────────────────
   .ns-login / .ns-field etc — activated by custom.js if injected.
   The LibreChat login restyle below targets the REAL auth DOM via
   body:has(img[src="/assets/logo.svg"]) — inert on all chat routes.
   ===================================================================== */

/* ── Design-system .ns-login elements ─────────────────────────────── */
.ns-login { display: flex; height: 100%; background: var(--bg); }
.ns-login-aside {
  width: 42%; max-width: 540px; flex-shrink: 0; display: flex; flex-direction: column;
  padding: 34px; border-right: 1px solid var(--border-soft);
  background: radial-gradient(120% 90% at 18% 12%, var(--accent-wash), transparent 60%),
              var(--bg-elevated);
}
.ns-login-aside-top { }
.ns-login-aside-mid {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 26px;
}
.ns-login-mark {
  width: 76px; height: 76px; border-radius: 22px; display: flex;
  align-items: center; justify-content: center; color: var(--accent);
  background: var(--surface); border: 1px solid var(--border);
}
.ns-login-claim { font-size: 30px; line-height: 1.3; letter-spacing: -0.02em;
  color: var(--text); margin: 0; }
.ns-login-aside-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-faint);
}
.ns-login-main {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 34px; gap: 18px;
}
.ns-login-card { width: 100%; max-width: 380px; }
.ns-login-brandsm { display: none; margin-bottom: 26px; }
.ns-login-h { font-size: 25px; font-weight: 300; letter-spacing: -0.02em;
  margin: 0 0 7px; color: var(--text); }
.ns-login-p { font-size: 14.5px; color: var(--text-muted); margin: 0 0 28px; line-height: 1.55; }
.ns-field { display: block; margin-bottom: 16px; }
.ns-field-label { display: block; font-size: 12.5px; font-weight: 500;
  color: var(--text-muted); margin-bottom: 7px; }
.ns-field input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text);
  font-size: 14.5px; outline: none; transition: .16s var(--ease);
  font-family: var(--font-sans);
}
.ns-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.ns-field input::placeholder { color: var(--text-faint); }
.ns-login-submit {
  width: 100%; padding: 12px; border-radius: var(--r-md); border: none; margin-top: 8px;
  background: var(--accent); color: var(--accent-ink); font-size: 14.5px; font-weight: 600;
  letter-spacing: -0.01em; transition: .16s var(--ease); font-family: var(--font-sans);
}
.ns-login-submit:hover { background: var(--accent-strong); }
.ns-login-hint {
  display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 20px;
  font-size: 12.5px; color: var(--text-faint);
}
.ns-login-legal { font-size: 11.5px; color: var(--text-faint); text-align: center; }
@media (max-width: 820px) {
  .ns-login-aside { display: none; }
  .ns-login-brandsm { display: block; }
}

/* =====================================================================
   LibreChat login page restyle
   Scope: html.dark body:has(img[src="/assets/logo.svg"])
   AuthLayout hardcodes that img src — appears nowhere in the chat UI.
   All rules below are inert on every non-auth route.
   Note: auth pages retain electric blue (#0066ff) for inputs/buttons;
   teal via --accent applies to the chat UI.
   ===================================================================== */

html.dark body:has(img[src="/assets/logo.svg"]) {
  --ns-blue:        #0066ff;
  --ns-blue-hover:  #0052cc;
  --ns-blue-dim:    rgba(0, 102, 255, 0.18);
  --ns-card-bg:     #080808;
  --ns-card-border: #1c1c2e;
  --ns-label-bg:    #080808;
  --ns-text:        #f0f0f0;
  --ns-radius:      6px;
}

/* Auth card */
html.dark body:has(img[src="/assets/logo.svg"]) div:has(> h1) {
  background-color: var(--ns-card-bg) !important;
  border: 1px solid var(--ns-card-border) !important;
  border-radius: 10px !important;
  padding: 2rem 1.75rem !important;
}

/* NeuralSafe logo: replace /assets/logo.svg */
html.dark body:has(img[src="/assets/logo.svg"]) div:has(> img[src="/assets/logo.svg"]) {
  position: relative;
}
html.dark body:has(img[src="/assets/logo.svg"]) div:has(> img[src="/assets/logo.svg"]) img {
  visibility: hidden;
}
html.dark body:has(img[src="/assets/logo.svg"]) div:has(> img[src="/assets/logo.svg"])::after {
  content: '';
  position: absolute; inset: 0;
  background: url('/brand/FullLogo.png') center / contain no-repeat;
  pointer-events: none;
}

/* Welcome heading — login page only */
html.dark body:has([data-testid="login-button"]) h1 {
  color: transparent !important;
  position: relative;
}
html.dark body:has([data-testid="login-button"]) h1::after {
  content: "Welcome to NeuralSafe Chat";
  position: absolute; inset: 0;
  color: var(--ns-text); font-size: 1.875rem; font-weight: 600;
  text-align: center; letter-spacing: -0.01em; white-space: nowrap;
}

/* Input fields */
html.dark body:has(img[src="/assets/logo.svg"]) input[type="text"],
html.dark body:has(img[src="/assets/logo.svg"]) input[type="password"],
html.dark body:has(img[src="/assets/logo.svg"]) input[type="email"] {
  border-radius: var(--ns-radius) !important;
  background-color: #0a0a0a !important;
}
html.dark body:has(img[src="/assets/logo.svg"]) input:focus {
  border-color: var(--ns-blue) !important;
  box-shadow: 0 0 0 3px var(--ns-blue-dim) !important;
  outline: none !important;
}
html.dark body:has(img[src="/assets/logo.svg"]) .focus\:border-green-500:focus {
  border-color: var(--ns-blue) !important;
}

/* Floating labels */
html.dark body:has(img[src="/assets/logo.svg"]) label {
  background-color: var(--ns-label-bg) !important;
}
html.dark body:has(img[src="/assets/logo.svg"]) input:focus ~ label {
  color: var(--ns-blue) !important;
}

/* Submit button */
html.dark body:has(img[src="/assets/logo.svg"]) button[type="submit"] {
  background-color: var(--ns-blue) !important;
  border-color:     var(--ns-blue) !important;
  border-radius:    var(--ns-radius) !important;
  letter-spacing:   0.06em;
  text-transform:   uppercase;
  font-size:        0.8rem !important;
  font-weight:      600 !important;
}
html.dark body:has(img[src="/assets/logo.svg"]) button[type="submit"]:hover {
  background-color: var(--ns-blue-hover) !important;
  border-color:     var(--ns-blue-hover) !important;
}
html.dark body:has(img[src="/assets/logo.svg"]) button[type="submit"]:focus {
  box-shadow: 0 0 0 3px var(--ns-blue-dim) !important;
  outline: none !important;
}

/* Links */
html.dark body:has(img[src="/assets/logo.svg"]) a[class*="green"],
html.dark body:has(img[src="/assets/logo.svg"]) [class*="text-green-5"],
html.dark body:has(img[src="/assets/logo.svg"]) [class*="text-green-6"],
html.dark body:has(img[src="/assets/logo.svg"]) [class*="dark\:text-green"] {
  color: var(--ns-blue) !important;
}
html.dark body:has(img[src="/assets/logo.svg"]) a[class*="green"]:hover {
  color: #4d94ff !important;
}

/* Theme selector — hidden (dark mode forced globally) */
html.dark body:has(img[src="/assets/logo.svg"]) .absolute.bottom-0.left-0 {
  display: none !important;
}

