/* NUMOTEQ v3 theme for LibreChat, generated by scripts/librechat-theme/generate.py.
   Same palette and rules as the Forgejo and Redmine themes. LibreChat colors are RGB triplets. */
:root {
  --gray-20: 247 247 243;
  --gray-50: 251 251 250;
  --gray-100: 242 242 236;
  --gray-200: 227 228 223;
  --gray-300: 199 201 196;
  --gray-400: 169 174 184;
  --gray-500: 105 110 122;
  --gray-600: 84 88 100;
  --gray-650: 66 72 85;
  --gray-700: 42 46 56;
  --gray-800: 34 38 47;
  --gray-850: 26 29 36;
  --gray-875: 20 22 27;
  --gray-900: 11 12 15;
}
html {
  color-scheme: light;
  --nq-canvas: #fbfbfa;
  --nq-chrome: #ffffff;
  --nq-card: #ffffff;
  --nq-raised: #ffffff;
  --nq-field: #ffffff;
  --nq-inset: #f2f2ec;
  --nq-hover: #f2f2ec;
  --nq-selected: #ecebe5;
  --nq-border: #e3e4df;
  --nq-border-strong: #c7c9c4;
  --nq-extrude: #1b1d22;
  --nq-check-edge: #1b1d22;
  --nq-ink: #0a0b0e;
  --nq-muted: #545864;
  --nq-subtle: #696e7a;
  --nq-faint: #a9aeb8;
  --nq-primary: #73f4f6;
  --nq-primary-ink: #04131a;
  --nq-accent: #b5f9fa;
  --nq-accent-strong: #2bbdbf;
  --nq-accent-text: #137274;
  --nq-accent-wash: #e8fafb;
  --nq-accent-wash-strong: #d3f6f6;
  --nq-ring: #137274;
  --nq-danger: #d94a5c;
  --nq-danger-text: #b8293c;
  --nq-danger-wash: #ffe7ea;
  --nq-success: #1fa060;
  --nq-success-text: #17693f;
  --nq-success-wash: #e6f6ec;
  --nq-warning: #b87900;
  --nq-warning-text: #825200;
  --nq-warning-wash: #fff4db;
  --nq-violet: #7a4fd6;
  --nq-violet-text: #5b34b0;
  --nq-violet-wash: #f1ebff;
  --nq-code-bg: #fafaf5;
  --nq-backdrop: #0a0b0e;
  --presentation: 251 251 250;
  --header-primary: 251 251 250;
  --header-hover: 242 242 236;
  --header-button-hover: 242 242 236;
  --text-primary: 10 11 14;
  --text-secondary: 84 88 100;
  --text-secondary-alt: 105 110 122;
  --text-tertiary: 105 110 122;
  --text-muted: 105 110 122;
  --text-warning: 130 82 0;
  --text-destructive: 184 41 60;
  --link: 19 114 116;
  --link-hover: 19 114 116;
  --link-visited: 19 114 116;
  --accent-primary: 19 114 116;
  --accent-primary-hover: 19 114 116;
  --ring-primary: 19 114 116;
  --surface-primary: 251 251 250;
  --surface-primary-alt: 255 255 255;
  --surface-primary-contrast: 242 242 236;
  --surface-secondary: 255 255 255;
  --surface-secondary-alt: 242 242 236;
  --surface-tertiary: 242 242 236;
  --surface-tertiary-alt: 255 255 255;
  --surface-hover: 242 242 236;
  --surface-hover-alt: 236 235 229;
  --surface-composer-hover: 242 242 236;
  --surface-active: 236 235 229;
  --surface-active-alt: 236 235 229;
  --surface-dialog: 255 255 255;
  --surface-overlay: 10 11 14;
  --surface-chat: 255 255 255;
  --surface-code: 250 250 245;
  --surface-qr: 255 255 255;
  --chart-widget-surface: 255 255 255;
  --chart-widget-stroke: 227 228 223;
  --surface-submit: 115 244 246;
  --surface-submit-hover: 181 249 250;
  --surface-destructive: 217 74 92;
  --surface-destructive-hover: 184 41 60;
  --surface-inverted: 10 11 14;
  --surface-inverted-hover: 84 88 100;
  --text-inverted: 251 251 250;
  --surface-fixed: 255 255 255;
  --surface-fixed-hover: 242 242 236;
  --text-fixed: 10 11 14;
  --border-light: 227 228 223;
  --border-medium: 199 201 196;
  --border-medium-alt: 199 201 196;
  --border-heavy: 105 110 122;
  --border-xheavy: 84 88 100;
  --border-destructive: 217 74 92;
  --status-success: 23 105 63;
  --status-success-subtle: 230 246 236;
  --status-success-border: 31 160 96;
  --status-success-strong: 31 160 96;
  --status-info: 19 114 116;
  --status-info-subtle: 232 250 251;
  --status-info-border: 43 189 191;
  --status-info-strong: 43 189 191;
  --status-warning: 130 82 0;
  --status-warning-subtle: 255 244 219;
  --status-warning-border: 184 121 0;
  --status-warning-strong: 184 121 0;
  --status-error: 184 41 60;
  --status-error-subtle: 255 231 234;
  --status-error-border: 217 74 92;
  --status-error-strong: 217 74 92;
  --status-neutral: 84 88 100;
  --status-neutral-subtle: 242 242 236;
  --status-neutral-border: 199 201 196;
  --status-verified: 19 114 116;
  --text-on-status: 251 251 250;
  --series-1: 43 189 191;
  --series-2: 122 79 214;
  --series-3: 31 160 96;
  --series-4: 184 121 0;
  --series-5: 217 74 92;
  --series-6: 91 52 176;
  --series-7: 23 105 63;
  --series-8: 84 88 100;
  --syntax-text: 10 11 14;
  --syntax-comment: 105 110 122;
  --syntax-meta: 84 88 100;
  --syntax-builtin: 130 82 0;
  --syntax-keyword: 91 52 176;
  --syntax-string: 23 105 63;
  --syntax-attr: 184 41 60;
  --syntax-title: 19 114 116;
  --switch-unchecked: 199 201 196;
  --brand-purple: 122 79 214;
}
html.dark {
  color-scheme: dark;
  --nq-canvas: #0b0c0f;
  --nq-chrome: #14161b;
  --nq-card: #1a1d24;
  --nq-raised: #22262f;
  --nq-field: #0b0c0f;
  --nq-inset: #0e1014;
  --nq-hover: #20242c;
  --nq-selected: #2a2e38;
  --nq-border: #2a2e38;
  --nq-border-strong: #424855;
  --nq-extrude: #336d6e;
  --nq-check-edge: #8a90a2;
  --nq-ink: #f4f5f1;
  --nq-muted: #b7bcc6;
  --nq-subtle: #8a90a2;
  --nq-faint: #555b67;
  --nq-primary: #73f4f6;
  --nq-primary-ink: #04131a;
  --nq-accent: #b5f9fa;
  --nq-accent-strong: #73f4f6;
  --nq-accent-text: #73f4f6;
  --nq-accent-wash: #132a2d;
  --nq-accent-wash-strong: #173b3e;
  --nq-ring: #b5f9fa;
  --nq-danger: #ff6a55;
  --nq-danger-text: #ff8f7c;
  --nq-danger-wash: #2b1714;
  --nq-success: #2fbf71;
  --nq-success-text: #5fd897;
  --nq-success-wash: #12261b;
  --nq-warning: #f5c542;
  --nq-warning-text: #f5c542;
  --nq-warning-wash: #2a2410;
  --nq-violet: #b48bff;
  --nq-violet-text: #c9adff;
  --nq-violet-wash: #211a33;
  --nq-code-bg: #0e1014;
  --nq-backdrop: #040609;
  --presentation: 11 12 15;
  --header-primary: 11 12 15;
  --header-hover: 32 36 44;
  --header-button-hover: 32 36 44;
  --text-primary: 244 245 241;
  --text-secondary: 183 188 198;
  --text-secondary-alt: 138 144 162;
  --text-tertiary: 138 144 162;
  --text-muted: 138 144 162;
  --text-warning: 245 197 66;
  --text-destructive: 255 143 124;
  --link: 115 244 246;
  --link-hover: 115 244 246;
  --link-visited: 115 244 246;
  --accent-primary: 115 244 246;
  --accent-primary-hover: 115 244 246;
  --ring-primary: 181 249 250;
  --surface-primary: 11 12 15;
  --surface-primary-alt: 20 22 27;
  --surface-primary-contrast: 14 16 20;
  --surface-secondary: 26 29 36;
  --surface-secondary-alt: 14 16 20;
  --surface-tertiary: 26 29 36;
  --surface-tertiary-alt: 26 29 36;
  --surface-hover: 32 36 44;
  --surface-hover-alt: 42 46 56;
  --surface-composer-hover: 32 36 44;
  --surface-active: 42 46 56;
  --surface-active-alt: 42 46 56;
  --surface-dialog: 26 29 36;
  --surface-overlay: 4 6 9;
  --surface-chat: 26 29 36;
  --surface-code: 14 16 20;
  --surface-qr: 255 255 255;
  --chart-widget-surface: 26 29 36;
  --chart-widget-stroke: 42 46 56;
  --surface-submit: 115 244 246;
  --surface-submit-hover: 181 249 250;
  --surface-destructive: 255 106 85;
  --surface-destructive-hover: 255 143 124;
  --surface-inverted: 244 245 241;
  --surface-inverted-hover: 183 188 198;
  --text-inverted: 11 12 15;
  --surface-fixed: 26 29 36;
  --surface-fixed-hover: 32 36 44;
  --text-fixed: 244 245 241;
  --border-light: 42 46 56;
  --border-medium: 66 72 85;
  --border-medium-alt: 66 72 85;
  --border-heavy: 138 144 162;
  --border-xheavy: 183 188 198;
  --border-destructive: 255 106 85;
  --status-success: 95 216 151;
  --status-success-subtle: 18 38 27;
  --status-success-border: 47 191 113;
  --status-success-strong: 47 191 113;
  --status-info: 115 244 246;
  --status-info-subtle: 19 42 45;
  --status-info-border: 115 244 246;
  --status-info-strong: 115 244 246;
  --status-warning: 245 197 66;
  --status-warning-subtle: 42 36 16;
  --status-warning-border: 245 197 66;
  --status-warning-strong: 245 197 66;
  --status-error: 255 143 124;
  --status-error-subtle: 43 23 20;
  --status-error-border: 255 106 85;
  --status-error-strong: 255 106 85;
  --status-neutral: 183 188 198;
  --status-neutral-subtle: 14 16 20;
  --status-neutral-border: 66 72 85;
  --status-verified: 115 244 246;
  --text-on-status: 11 12 15;
  --series-1: 115 244 246;
  --series-2: 180 139 255;
  --series-3: 47 191 113;
  --series-4: 245 197 66;
  --series-5: 255 106 85;
  --series-6: 201 173 255;
  --series-7: 95 216 151;
  --series-8: 183 188 198;
  --syntax-text: 244 245 241;
  --syntax-comment: 138 144 162;
  --syntax-meta: 183 188 198;
  --syntax-builtin: 245 197 66;
  --syntax-keyword: 201 173 255;
  --syntax-string: 95 216 151;
  --syntax-attr: 255 143 124;
  --syntax-title: 115 244 246;
  --switch-unchecked: 66 72 85;
  --brand-purple: 180 139 255;
}

/* ───────────────────────── System tokens ───────────────────────── */

@font-face { font-family: "NQ Sora"; src: url("./sora-variable.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "NQ Inter"; src: url("./inter-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "NQ JetBrains Mono"; src: url("./jetbrains-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NQ JetBrains Mono"; src: url("./jetbrains-mono-500.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }

html {
  --nq-font-body: "NQ Inter", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nq-font-head: "NQ Sora", "NQ Inter", ui-sans-serif, system-ui, sans-serif;
  --nq-font-mono: "NQ JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nq-radius-xs: 4px;
  --nq-radius-sm: 6px;
  --nq-radius-md: 8px;
  --nq-radius-lg: 12px;
  --nq-radius-pill: 999px;
  --nq-control-h: 32px;
  --nq-grid-size: 56px;
  --nq-grid: rgb(27 29 34 / .05);
  --nq-depth: rgb(27 29 34 / .12);
  /* Hard offsets. Raised = the one primary action; pop = menus and popovers; dialog = modal surfaces. */
  --nq-shadow-raised: 2px 2px 0 var(--nq-extrude);
  --nq-shadow-raised-hover: 3px 3px 0 var(--nq-extrude);
  --nq-shadow-raised-active: 1px 1px 0 var(--nq-extrude);
  --nq-shadow-pop: 4px 4px 0 var(--nq-border), 0 14px 36px -12px var(--nq-depth);
  --nq-shadow-dialog: 6px 6px 0 var(--nq-border-strong), 0 28px 70px -24px var(--nq-depth);
  --nq-focus-ring: 0 0 0 3px color-mix(in srgb, var(--nq-accent-strong) 28%, transparent);
  --nq-ease: cubic-bezier(.2, .7, .2, 1);
  --nq-fast: 120ms;

  /* LibreChat's own theme tokens */
  --radius: var(--nq-radius-sm);
  --theme-control-radius: var(--nq-radius-sm);
  --theme-round-control-radius: var(--nq-radius-sm);
  --theme-surface-radius: var(--nq-radius-md);
  --theme-large-surface-radius: var(--nq-radius-lg);
  --theme-control-height: var(--nq-control-h);
  --theme-font-family: var(--nq-font-body);
  --theme-elevation-surface: var(--nq-shadow-pop);
  --theme-motion-fast: var(--nq-fast);
  accent-color: var(--nq-primary);
  scrollbar-color: var(--nq-border-strong) transparent;
}
html { --nq-grid-hero: rgb(27 29 34 / .08); }
html.dark {
  --nq-grid-hero: rgb(255 255 255 / .07);
  --nq-grid: rgb(255 255 255 / .045);
  --nq-depth: rgb(0 0 0 / .5);
}

/* ───────────────────────── Base ───────────────────────── */

body, .font-theme-ui, button, input, select, textarea { font-family: var(--nq-font-body); }
body { -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3 { font-family: var(--nq-font-head); letter-spacing: -.015em; }
code, pre, kbd, samp, .font-mono { font-family: var(--nq-font-mono) !important; }
::selection { background: var(--nq-primary); color: var(--nq-primary-ink); }
:focus-visible { outline: 2px solid var(--nq-ring); outline-offset: 2px; }
/* LibreChat's Tailwind focus rings (ring-text-primary, ring-border-heavy…) use the same ring colour. */
[class]:focus-visible { --tw-ring-color: var(--nq-ring) !important; }
::placeholder { color: var(--nq-subtle) !important; opacity: 1; }

/* Autofill-safe fields: LibreChat paints them with a fixed inset colour. */
.webkit-dark-styles, .webkit-dark-styles:focus,
.dark .webkit-dark-styles, .dark .webkit-dark-styles:focus {
  box-shadow: 0 0 0 50vh var(--nq-field) inset;
  -webkit-text-fill-color: var(--nq-ink);
}

/* ───────────────────────── The page's primary action ───────────────────────── */

/* Send is the one raised action: solid cyan with the hard offset, ink glyph. */
#send-button:not(:disabled), .bg-surface-submit, button.bg-surface-submit {
  background: var(--nq-primary) !important;
  border: 1px solid var(--nq-extrude) !important;
  box-shadow: var(--nq-shadow-raised) !important;
  color: var(--nq-primary-ink) !important;
  transition: box-shadow var(--nq-fast) var(--nq-ease), transform var(--nq-fast) var(--nq-ease);
}
#send-button svg, .bg-surface-submit svg { color: currentColor !important; }
#send-button { border: 1px solid transparent; }
#send-button:disabled {
  background: var(--nq-hover) !important;
  border-color: var(--nq-border) !important;
  color: var(--nq-faint) !important;
  opacity: 1 !important;
}
#send-button:hover:not(:disabled), .bg-surface-submit:hover:not(:disabled) { box-shadow: var(--nq-shadow-raised-hover) !important; transform: translate(-1px, -1px); }
#send-button:active:not(:disabled), .bg-surface-submit:active:not(:disabled) { box-shadow: var(--nq-shadow-raised-active) !important; transform: translate(1px, 1px); }
.bg-surface-submit:disabled, .bg-surface-submit[disabled] {
  background: var(--nq-hover) !important;
  border-color: var(--nq-border) !important;
  box-shadow: none !important;
  color: var(--nq-faint) !important;
  opacity: 1 !important;
  transform: none;
}

/* Legacy buttons */
.btn { border-radius: var(--nq-radius-sm); font-weight: 500; }
.btn-primary {
  background: var(--nq-primary) !important;
  border: 1px solid var(--nq-extrude) !important;
  box-shadow: var(--nq-shadow-raised);
  color: var(--nq-primary-ink) !important;
  font-weight: 600;
}
.btn-primary:hover { box-shadow: var(--nq-shadow-raised-hover); transform: translate(-1px, -1px); }
.btn-neutral, .btn-secondary {
  background: var(--nq-card) !important;
  border: 1px solid var(--nq-border-strong) !important;
  color: var(--nq-ink) !important;
}
.btn-neutral:hover, .btn-secondary:hover { background: var(--nq-hover) !important; border-color: var(--nq-subtle) !important; }

/* ───────────────────────── Page frame ───────────────────────── */

/* The grid lives in the margins: it fades out before the centred chat column. */
.bg-presentation:has(> #messages-view),
.bg-presentation:has(> [data-testid="messages-view"]) { position: relative; isolation: isolate; }
.bg-presentation:has(> [data-testid="messages-view"])::before {
  background-image:
    linear-gradient(var(--nq-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--nq-grid) 1px, transparent 1px);
  background-position: center top;
  background-size: var(--nq-grid-size) var(--nq-grid-size);
  content: "";
  inset: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(50% - 34rem), transparent calc(50% - 29rem), transparent calc(50% + 29rem), #000 calc(50% + 34rem), #000 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(50% - 34rem), transparent calc(50% - 29rem), transparent calc(50% + 29rem), #000 calc(50% + 34rem), #000 100%);
  pointer-events: none;
  position: absolute;
  z-index: -1;
}
.bg-presentation:has(> [data-testid="messages-view"]) > [data-testid="messages-view"],
.bg-presentation:has(> [data-testid="messages-view"]) { background-color: var(--nq-canvas); }
[data-testid="messages-view"] .bg-presentation:has(> form) { background: transparent; }


/* Sidebar: chrome surface, hairline edge. */
aside[aria-label="Control Panel"] .bg-surface-primary-alt { background: var(--nq-chrome); }
aside[aria-label="Control Panel"] > div > div:first-child { border-color: var(--nq-border); }
nav.bg-surface-primary-alt { border-inline-end: 1px solid var(--nq-border); }

/* Section labels (Projects, Chats) and date groups are mono labels. */
nav [aria-label="Chat History"] .h-8 > button:first-child span,
nav h2[aria-label^="Chats from"], nav [data-testid="convo-list-row"] h2 {
  color: var(--nq-subtle);
  font-family: var(--nq-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
/* Date groups start where the conversation titles start. */
nav [data-testid="convo-list-row"] h2 { padding-inline-start: 8px; }

/* Conversation rows: quiet hover, the open one is ink + an inset accent pill, no fill. */
[data-testid="convo-item"] { border-radius: var(--nq-radius-sm); height: 36px; }
[data-testid="convo-item"] > button { border-radius: var(--nq-radius-sm); color: var(--nq-muted); }
[data-testid="convo-item"]:hover > button, [data-testid="convo-item"]:hover { background: var(--nq-hover); color: var(--nq-ink); }
[data-testid="convo-item"]:is(.bg-surface-active-alt, [aria-current="page"], :has([aria-current="page"])),
[data-testid="convo-item"] > button[aria-current="page"] {
  background: transparent;
  position: relative;
}
[data-testid="convo-item"]:is(.bg-surface-active-alt, [aria-current="page"], :has([aria-current="page"])) > button { color: var(--nq-ink); font-weight: 600; }
[data-testid="convo-item"]:is(.bg-surface-active-alt, [aria-current="page"], :has([aria-current="page"]))::before {
  background: var(--nq-accent-strong);
  border-radius: 2px;
  content: "";
  inline-size: 2px;
  bottom: 9px;
  left: 0;
  position: absolute;
  top: 9px;
  width: 2px;
}
[data-testid="convo-icon"] { display: none; }

/* ───────────────────────── Header controls ───────────────────────── */

[data-testid="model-selector-button"],
#bookmark-menu-button, [data-testid="add-multi-convo-button"], #export-menu-button {
  background: var(--nq-card);
  border-color: var(--nq-border-strong);
  border-radius: var(--nq-radius-sm);
  height: 36px;
}
[data-testid="model-selector-button"] { font-weight: 600; }
#bookmark-menu-button, [data-testid="add-multi-convo-button"], #export-menu-button { width: 36px; }
:is([data-testid="model-selector-button"], #bookmark-menu-button, [data-testid="add-multi-convo-button"], #export-menu-button):hover {
  background: var(--nq-hover);
  border-color: var(--nq-subtle);
}

/* ───────────────────────── Messages ───────────────────────── */

/* The user's turn: an inset card with a hairline, its corner toward the speaker tighter. */
.user-turn [data-testid="message-body"] {
  background: var(--nq-inset);
  border: 1px solid var(--nq-border);
  border-radius: var(--nq-radius-lg) var(--nq-radius-lg) var(--nq-radius-xs) var(--nq-radius-lg);
}
html.dark .user-turn [data-testid="message-body"] { background: var(--nq-card); }
/* Assistant name: Inter, the avatar a quiet tile. */
.agent-turn > h2 { font-family: var(--nq-font-body); font-size: 13.5px; font-weight: 600; letter-spacing: 0; }
.agent-turn > h2 > span:first-child {
  background: var(--nq-card);
  border: 1px solid var(--nq-border-strong);
  border-radius: var(--nq-radius-sm);
}
.message-timestamp { color: var(--nq-subtle); font-family: var(--nq-font-mono); font-size: 11px; }
.hover-button { border-radius: var(--nq-radius-sm); color: var(--nq-subtle); }
.hover-button:hover { background: var(--nq-hover); color: var(--nq-ink); }

/* Thinking: a mono label. */
.tool-status-text > span:last-child {
  color: var(--nq-subtle);
  font-family: var(--nq-font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ───────────────────────── Markdown ───────────────────────── */

.markdown { color: var(--nq-ink); font-size: 15px; line-height: 1.65; }
.markdown :is(h1, h2, h3) { color: var(--nq-ink); font-family: var(--nq-font-head); font-weight: 600; letter-spacing: -.02em; }
.markdown h1 { font-size: 1.5em; }
.markdown h2 { font-size: 1.3em; }
.markdown h3 { font-size: 1.1em; }
.markdown :is(h4, h5, h6) { font-family: var(--nq-font-body); font-weight: 600; }
.markdown strong { color: var(--nq-ink); font-weight: 600; }
html .markdown a, html .markdown a:visited, html .markdown :is(p, li, td, th, blockquote) a { color: var(--nq-accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--nq-accent-text) 40%, transparent); text-underline-offset: 3px; }
.markdown a:hover { text-decoration-color: currentColor; }
.markdown :is(ul, ol) > li::marker { color: var(--nq-subtle); }
.markdown hr { border-color: var(--nq-border); }
.markdown blockquote { border-inline-start: 3px solid var(--nq-border-strong); color: var(--nq-muted); font-style: normal; }
.markdown blockquote p:first-of-type::before, .markdown blockquote p:last-of-type::after { content: none; }

/* Inline code: inset chip, no backticks. */
.markdown code:not(pre code) {
  background: var(--nq-inset);
  border: 1px solid var(--nq-border);
  border-radius: var(--nq-radius-xs);
  color: var(--nq-ink);
  font-size: .86em;
  font-weight: 500;
  padding: .1em .35em;
}
.markdown code::before, .markdown code::after { content: none !important; }
.markdown pre code { background: transparent; border: 0; padding: 0; }

/* Code blocks: one bordered panel, a chrome header with a mono language label. */
.markdown pre { background: transparent; border-radius: 0; margin-block: 1em; padding: 0; }
.markdown pre > div:first-child {
  background: var(--nq-code-bg);
  border: 1px solid var(--nq-border) !important;
  border-radius: var(--nq-radius-md) !important;
}
.markdown pre > div:first-child > div:first-child > div {
  background: var(--nq-chrome) !important;
  border-block-end: 1px solid var(--nq-border);
  padding: 4px 6px 4px 12px;
}
.markdown pre > div:first-child > div:first-child > div > span {
  color: var(--nq-subtle);
  font-family: var(--nq-font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.markdown pre > div:first-child > div:first-child > div button { border-radius: var(--nq-radius-sm); color: var(--nq-subtle); font-family: var(--nq-font-body); height: 28px; }
.markdown pre > div:first-child > div:first-child > div button:hover { background: var(--nq-hover); color: var(--nq-ink); }
.markdown pre > div:first-child > .overflow-y-auto { background: var(--nq-code-bg) !important; font-size: 13px; line-height: 1.6; padding: 14px 16px; }

/* Syntax colours on the palette. */
.hljs { color: var(--nq-ink); }
:is(.hljs-comment, .hljs-quote) { color: var(--nq-subtle); font-style: italic; }
:is(.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag) { color: var(--nq-violet-text); }
:is(.hljs-string, .hljs-addition, .hljs-regexp) { color: var(--nq-success-text); }
:is(.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-built_in, .hljs-type) { color: var(--nq-warning-text); }
:is(.hljs-title, .hljs-section, .hljs-function .hljs-title, .hljs-class .hljs-title) { color: var(--nq-accent-text); }
:is(.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-selector-id, .hljs-selector-class) { color: var(--nq-danger-text); }
:is(.hljs-meta, .hljs-meta-string, .hljs-link) { color: var(--nq-muted); }
.hljs-deletion { color: var(--nq-danger-text); }

/* Tables: a hairline panel, mono column labels. */
.markdown-table-wrapper { border: 1px solid var(--nq-border); border-radius: var(--nq-radius-md); margin-block: 1em; overflow-x: auto; }
.markdown-table-wrapper table { border: 0; border-collapse: separate; border-spacing: 0; margin: 0; width: 100%; }
html .markdown .markdown-table-wrapper :is(th, td) { border: 0 !important; border-block-start: 1px solid var(--nq-border) !important; border-radius: 0 !important; padding: 8px 12px; }
.markdown .markdown-table-wrapper th, html.dark .markdown .markdown-table-wrapper th {
  background: var(--nq-inset);
  border-block-start: 0;
  color: var(--nq-subtle);
  font-family: var(--nq-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.markdown-table-wrapper td { font-variant-numeric: tabular-nums; }
html .markdown .markdown-table-wrapper thead th { border-block-start: 0 !important; }
.markdown-table-wrapper tbody tr:hover td { background: var(--nq-hover); }

/* ───────────────────────── Composer ───────────────────────── */

[data-testid="composer-surface"] {
  background: var(--nq-card);
  border: 1px solid var(--nq-border-strong);
  border-radius: var(--nq-radius-lg) !important;
  box-shadow: none;
  transition: border-color var(--nq-fast) var(--nq-ease), box-shadow var(--nq-fast) var(--nq-ease);
}
[data-testid="composer-surface"]:hover { border-color: var(--nq-subtle); }
[data-testid="composer-surface"]:focus-within { border-color: var(--nq-accent-strong); box-shadow: var(--nq-focus-ring); }
/* Tools switched on in the composer (Artifacts, web search, code…): the selected state is an
   accent edge on a pale accent wash with ink text, the same for every tool. */
[data-testid="composer-surface"] [class*="border-series-"] { border-color: var(--nq-accent-strong) !important; }
[data-testid="composer-surface"] [class*="bg-series-"] { background: var(--nq-accent-wash) !important; }
[data-testid="composer-surface"] [class*="bg-series-"]:hover { background: var(--nq-accent-wash-strong) !important; }
[data-testid="composer-surface"] [class*="border-series-"] :is(span, svg) { color: var(--nq-ink) !important; }
#prompt-textarea { color: var(--nq-ink); font-size: 15px; }
#prompt-textarea:focus-visible { outline: none; }

/* ───────────────────────── Menus and popovers ───────────────────────── */

.popover-ui, .popover, [role="menu"], [role="listbox"]:not(select) {
  background: var(--nq-raised);
  border: 1px solid var(--nq-border-strong);
  border-radius: var(--nq-radius-md);
  box-shadow: var(--nq-shadow-pop);
  color: var(--nq-ink);
}
.select-item, [role="menuitem"], [role="option"] { border-radius: var(--nq-radius-sm); }
/* Items are rows of the menu, not tiles on it. */
:is(.popover-ui, [role="menu"]) [role="menuitem"].bg-surface-secondary:not(:hover, [data-active-item]) { background: transparent; }
/* Group labels inside menus (Show, Sort chats by…) are mono labels. */
:is(.popover-ui, [role="menu"]) [role="group"] > div:first-child:not([role]):not(:has(*)) {
  color: var(--nq-subtle);
  font-family: var(--nq-font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.select-item[data-active-item], [role="menuitem"]:hover, [role="menuitem"][data-highlighted], [role="option"][data-highlighted] {
  background: var(--nq-hover);
  color: var(--nq-ink);
}

/* ───────────────────────── Dialogs ───────────────────────── */

[role="dialog"] { color: var(--nq-ink); }
[role="dialog"]:is(.bg-surface-dialog, .bg-surface-primary, .bg-white) {
  border: 1px solid var(--nq-border-strong);
  border-radius: var(--nq-radius-lg);
  box-shadow: var(--nq-shadow-dialog);
}
[id^="headlessui-dialog-panel"] {
  background: var(--nq-card);
  border: 1px solid var(--nq-border-strong);
  border-radius: var(--nq-radius-lg) !important;
  box-shadow: var(--nq-shadow-dialog) !important;
}
[id^="headlessui-dialog-panel"] [id^="headlessui-dialog-title"] { border-color: var(--nq-border); }
[id^="headlessui-dialog"] > .fixed.inset-0.bg-black, .fixed.inset-0:is(.bg-black\/50, .bg-black\/60, .bg-black\/80, .bg-surface-overlay) {
  background: var(--nq-backdrop) !important;
  opacity: .62 !important;
}
html.dark [id^="headlessui-dialog"] > .fixed.inset-0.bg-black { opacity: .74 !important; }
[role="dialog"] h2 { font-family: var(--nq-font-head); font-weight: 600; letter-spacing: -.015em; }

/* ───────────────────────── Fields ───────────────────────── */

input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="number"], [type="url"]):not(#prompt-textarea),
select, textarea:not(#prompt-textarea) {
  border-radius: var(--nq-radius-sm);
}
input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="number"], [type="url"]):focus-visible,
textarea:not(#prompt-textarea):focus-visible, select:focus-visible {
  border-color: var(--nq-accent-strong) !important;
  box-shadow: var(--nq-focus-ring) !important;
  outline: none !important;
}
/* Autofill-safe fields paint their fill as an inset shadow (content-box background): keep it under the ring. */
html .webkit-dark-styles:is(:focus, :focus-visible) { box-shadow: 0 0 0 50vh var(--nq-field) inset, var(--nq-focus-ring) !important; }

/* ───────────────────────── Brand frame ─────────────────────────
   The Numoteq look of the Forgejo theme: a 52px top band across the sidebar and the chat
   (brand row on one side, header with the hero grid on the other, one hairline under both),
   a page intro with a mono eyebrow, and the grid only where no content sits. */

/* Header band: opaque, so scrolled messages never sit on the grid. */
main[role="main"] > div > div > .absolute.top-0.z-20 {
  background: var(--nq-canvas);
  border-block-end: 1px solid var(--nq-border);
  isolation: isolate;
}
main[role="main"] > div > div > .absolute.top-0.z-20::before {
  background-attachment: fixed;
  background-image:
    linear-gradient(to right, var(--nq-grid-hero) 1px, transparent 1px),
    linear-gradient(to bottom, var(--nq-grid-hero) 1px, transparent 1px);
  background-position: center top;
  background-size: var(--nq-grid-size) var(--nq-grid-size);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

/* New chat: the hero continues under the header and dissolves before the greeting. */
main[role="main"]:has(p.split-parent) > div { isolation: isolate; }
main[role="main"]:has(p.split-parent) > div::before {
  background-attachment: fixed;
  background-image:
    linear-gradient(to right, var(--nq-grid-hero) 1px, transparent 1px),
    linear-gradient(to bottom, var(--nq-grid-hero) 1px, transparent 1px);
  background-position: center top;
  background-size: var(--nq-grid-size) var(--nq-grid-size);
  content: "";
  height: max(120px, calc(50% - 150px));
  inset-inline: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgb(0 0 0 / .55) 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, rgb(0 0 0 / .55) 45%, transparent 100%);
  pointer-events: none;
  position: absolute;
  top: 52px;
  z-index: -1;
}

/* Brand row on top of the chat list: the logo tile and the wordmark, on the header's hairline. */
aside[aria-label="Control Panel"] nav > div:first-child::before {
  align-items: center;
  background: url("../logo.svg") no-repeat 12px center / 26px 26px;
  border-block-end: 1px solid var(--nq-border);
  color: var(--nq-ink);
  content: "NUMOTEQ";
  display: flex;
  flex: 0 0 52px;
  font-family: var(--nq-font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  min-height: 52px;
  padding-inline-start: 48px;
}

/* Page intro on a new chat: mono eyebrow with the accent dot, the greeting as the page title. */
div:has(> div > p.split-parent)::before {
  background:
    radial-gradient(circle at 5px 50%, var(--nq-accent-strong) 3px, transparent 3.5px),
    radial-gradient(circle at 5px 50%, color-mix(in srgb, var(--nq-accent-strong) 16%, transparent) 6px, transparent 6.5px);
  background-repeat: no-repeat;
  color: var(--nq-subtle);
  content: "Numoteq";
  font-family: var(--nq-font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  line-height: 16px;
  margin-block-end: 12px;
  padding-inline-start: 18px;
  text-transform: uppercase;
}
div:has(> div > p.split-parent) { padding-block-end: 20px; }
p.split-parent {
  color: var(--nq-ink);
  font-family: var(--nq-font-head);
  font-weight: 650;
  letter-spacing: -.03em;
}
div:has(> p.split-parent) > .relative.size-10 > div {
  background: var(--nq-card);
  border: 1px solid var(--nq-border-strong);
  border-radius: var(--nq-radius-md);
  box-shadow: none;
}
div:has(> p.split-parent) > .relative.size-10 > div::after { box-shadow: none !important; content: none; }

/* Footer line: a mono label. */
main[role="main"] .relative.w-full > .absolute.bottom-0.text-xs {
  color: var(--nq-subtle);
  font-family: var(--nq-font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Phone drawer header: one row height (LibreChat mixes 40 and 36px controls). */
#close-sidebar-button { height: 36px; width: 36px; }
[data-testid="panel-switcher-button"] { height: 36px; }

/* Icon rail: the open panel is ink with the accent marker, no fill. */
[data-testid^="nav-panel-"] { color: var(--nq-muted); position: relative; }
[data-testid^="nav-panel-"][aria-pressed="true"] { background: transparent; color: var(--nq-ink); }
[data-testid^="nav-panel-"][aria-pressed="true"]:hover { background: var(--nq-hover); }
[data-testid^="nav-panel-"][aria-pressed="true"]::before {
  background: var(--nq-accent-strong);
  border-radius: 2px;
  bottom: 9px;
  content: "";
  left: 0;
  position: absolute;
  top: 9px;
  width: 2px;
}

/* ───────────────────────── Settings controls ───────────────────────── */

/* Switches: the checked track carries the accent, the thumb stays a flat disc. */
[role="switch"][data-state="checked"] { background: var(--nq-accent-strong) !important; }
[role="switch"][data-state="unchecked"] { background: var(--nq-border-strong) !important; }
[role="switch"] > span { background: var(--nq-card); box-shadow: none !important; }
html:not(.dark) [role="switch"] > span { background: #ffffff; }
html.dark [role="switch"][data-state="checked"] > span { background: var(--nq-canvas); }

/* Vertical tabs (settings): the active one is ink with the inset marker, no fill. */
[role="tablist"][aria-orientation="vertical"] [role="tab"], [role="dialog"] [role="tab"][data-orientation="vertical"] { position: relative; }
[role="dialog"] [role="tab"][data-orientation="vertical"][data-state="active"] { background: transparent; color: var(--nq-ink); }
[role="dialog"] [role="tab"][data-orientation="vertical"][data-state="active"]:hover { background: var(--nq-hover); }
[role="dialog"] [role="tab"][data-orientation="vertical"][data-state="active"]::before {
  background: var(--nq-accent-strong);
  border-radius: 2px;
  bottom: 9px;
  content: "";
  left: 0;
  position: absolute;
  top: 9px;
  width: 2px;
}

/* Danger stays flat: signal colour, never a solid red block, never extruded. */
.bg-surface-destructive {
  background: var(--nq-card) !important;
  border: 1px solid var(--nq-danger) !important;
  box-shadow: none !important;
  color: var(--nq-danger-text) !important;
}
.bg-surface-destructive:hover:not(:disabled) { background: var(--nq-danger-wash) !important; }

/* Phone "New chat" in the drawer: a neutral button; send stays the one primary. */
[data-testid="nav-new-chat-fab"] {
  background: var(--nq-card) !important;
  border: 1px solid var(--nq-border-strong);
  color: var(--nq-ink) !important;
}
[data-testid="nav-new-chat-fab"]:hover { background: var(--nq-hover) !important; border-color: var(--nq-subtle); }

/* ───────────────────────── Sign in and registration ─────────────────────────
   The auth card is a panel on the drafting table: the grid fills the page and dissolves
   around the card, the eyebrow and title open it like every page intro. */
#root > .min-h-screen:has(.w-authPageWidth) { background: var(--nq-canvas); isolation: isolate; }
#root > .min-h-screen:has(.w-authPageWidth)::before {
  background-image:
    linear-gradient(to right, var(--nq-grid-hero) 1px, transparent 1px),
    linear-gradient(to bottom, var(--nq-grid-hero) 1px, transparent 1px);
  background-position: center center;
  background-size: var(--nq-grid-size) var(--nq-grid-size);
  content: "";
  inset: 0;
  -webkit-mask-image: radial-gradient(ellipse 560px 420px at center, transparent 45%, #000 100%);
  mask-image: radial-gradient(ellipse 560px 420px at center, transparent 45%, #000 100%);
  pointer-events: none;
  position: fixed;
  z-index: -1;
}
#root > .min-h-screen:has(.w-authPageWidth) > div:first-child img { filter: none; }
.w-authPageWidth {
  background: var(--nq-card);
  border: 1px solid var(--nq-border);
  border-radius: var(--nq-radius-lg);
  padding: 28px 28px 12px;
}
.w-authPageWidth::before {
  background:
    radial-gradient(circle at 5px 50%, var(--nq-accent-strong) 3px, transparent 3.5px),
    radial-gradient(circle at 5px 50%, color-mix(in srgb, var(--nq-accent-strong) 16%, transparent) 6px, transparent 6.5px);
  background-repeat: no-repeat;
  color: var(--nq-subtle);
  content: "Numoteq";
  display: table;
  font-family: var(--nq-font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  line-height: 16px;
  margin: 0 auto 10px;
  padding-inline-start: 18px;
  text-transform: uppercase;
}
.w-authPageWidth h1 { font-family: var(--nq-font-head); font-size: 26px; font-weight: 650; letter-spacing: -.03em; }
.w-authPageWidth label.bg-surface-primary { background: linear-gradient(var(--nq-card) 50%, var(--nq-field) 50%); }
.w-authPageWidth input:placeholder-shown:not(:focus) + label { background: transparent; }
@media (max-width: 639px) {
  .w-authPageWidth { background: transparent; border: 0; }
  .w-authPageWidth label.bg-surface-primary { background: var(--nq-canvas); }
}

/* Shape and elevation: the bundle's Tailwind radius and shadow scale on NUMOTEQ values. */
.tooltip{box-shadow:none}
.popover-ui{box-shadow:var(--nq-shadow-pop)}
.popover-ui:where(.dark,.dark *){box-shadow:var(--nq-shadow-pop)}
.rounded-2xl{border-radius:var(--nq-radius-lg)}
.rounded-3xl{border-radius:var(--nq-radius-lg)}
.rounded-xl{border-radius:var(--nq-radius-md)}
.rounded-b-xl{border-bottom-right-radius:var(--nq-radius-md);border-bottom-left-radius:var(--nq-radius-md)}
.rounded-t-2xl{border-top-left-radius:var(--nq-radius-lg);border-top-right-radius:var(--nq-radius-lg)}
.rounded-t-3xl{border-top-left-radius:var(--nq-radius-lg);border-top-right-radius:var(--nq-radius-lg)}
.rounded-t-xl{border-top-left-radius:var(--nq-radius-md);border-top-right-radius:var(--nq-radius-md)}
.rounded-tr-xl{border-top-right-radius:var(--nq-radius-md)}
.shadow{box-shadow:none}
.shadow-2xl{box-shadow:var(--nq-shadow-dialog)}
.shadow-lg{box-shadow:var(--nq-shadow-pop)}
.shadow-md{box-shadow:none}
.shadow-sm{box-shadow:none}
.shadow-xl{box-shadow:var(--nq-shadow-pop)}
.prose :where(pre):not(:where([class~=not-prose] *)){border-radius:var(--nq-radius-md)}
.markdown th:first-child{border-top-left-radius:var(--nq-radius-md)}
.markdown th:last-child{border-top-right-radius:var(--nq-radius-md)}
.markdown tbody tr:last-child td:first-child{border-bottom-left-radius:var(--nq-radius-md)}
.markdown tbody tr:last-child td:last-child{border-bottom-right-radius:var(--nq-radius-md)}
.first\:rounded-l-xl:first-child{border-top-left-radius:var(--nq-radius-md);border-bottom-left-radius:var(--nq-radius-md)}
.first\:rounded-t-xl:first-child{border-top-left-radius:var(--nq-radius-md);border-top-right-radius:var(--nq-radius-md)}
.last\:rounded-b-xl:last-child{border-bottom-right-radius:var(--nq-radius-md);border-bottom-left-radius:var(--nq-radius-md)}
.last\:rounded-r-xl:last-child{border-top-right-radius:var(--nq-radius-md);border-bottom-right-radius:var(--nq-radius-md)}
.focus-within\:shadow-lg:focus-within{box-shadow:var(--nq-shadow-pop)}
.hover\:shadow-md:hover{box-shadow:none}
.hover\:shadow-sm:hover{box-shadow:none}
.hover\:shadow-xl:hover{box-shadow:var(--nq-shadow-pop)}
.focus\:shadow-lg:focus{box-shadow:var(--nq-shadow-pop)}
.data-\[state\=active\]\:shadow-sm[data-state=active]{box-shadow:none}
@media not all and (width>=768px){.max-md\:rounded-t-2xl{border-top-left-radius:var(--nq-radius-lg);border-top-right-radius:var(--nq-radius-lg)}}
@media not all and (width>=768px){.max-md\:shadow-lg{box-shadow:var(--nq-shadow-pop)}}
@media (width>=640px){.sm\:rounded-3xl{border-radius:var(--nq-radius-lg)}}
@media (width>=768px){.md\:rounded-2xl{border-radius:var(--nq-radius-lg)}}
@media (width>=768px){.md\:rounded-3xl{border-radius:var(--nq-radius-lg)}}
@media (width>=768px){.md\:rounded-xl{border-radius:var(--nq-radius-md)}}
/* Components that must win over the shape layer. */
/* Round things (avatars, switch thumbs, status dots) stay round and flat. */
.rounded-full:is(.shadow-sm, .shadow, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl) { box-shadow: none; }
