/* Nomad AI Research Preserve — LibreChat v0.8.8.
 * Tokens: client/src/style.css and packages/client/src/theme/types/index.ts.
 * Stable hooks: Chat/Input/ChatForm.tsx, SendButton.tsx, and
 * UnifiedSidebar/ExpandedPanel.tsx. No generated class names are patched.
 * High-contrast/forced-colors remain owned by LibreChat and the browser.
 */
html:not(.high-contrast) {
  --presentation: 244 247 251;
  --surface-primary: 255 255 255;
  --surface-primary-alt: 235 241 249;
  --surface-primary-contrast: 228 236 247;
  --surface-secondary: 245 248 252;
  --surface-secondary-alt: 233 240 249;
  --surface-tertiary: 225 235 247;
  --surface-tertiary-alt: 255 255 255;
  --surface-active: 221 234 250;
  --surface-active-alt: 209 226 247;
  --surface-hover: 224 234 247;
  --surface-hover-alt: 211 226 245;
  --surface-composer-hover: 232 240 250;
  --surface-dialog: 253 254 255;
  --surface-overlay: 15 30 52;
  --surface-chat: 235 242 252;
  --surface-code: 234 240 248;
  --header-primary: 244 247 251;
  --header-hover: 225 235 247;
  --header-button-hover: 224 234 247;
  --text-primary: 18 37 62;
  --text-secondary: 55 77 104;
  --text-secondary-alt: 67 88 114;
  --text-tertiary: 72 93 120;
  --text-muted: 77 98 122;
  --accent-primary: 31 93 159;
  --accent-primary-hover: 21 68 121;
  --surface-submit: 35 95 162;
  --surface-submit-hover: 25 75 134;
  --link: 26 86 151;
  --link-hover: 16 62 116;
  --link-visited: 87 74 147;
  --ring-primary: 40 98 159;
  --border-light: 205 218 235;
  --border-medium: 176 194 218;
  --border-medium-alt: 159 182 211;
  --border-heavy: 87 113 146;
  --border-xheavy: 65 92 127;
  --chart-widget-surface: 255 255 255;
  --chart-widget-stroke: 205 218 235;
  --nomad-gold: 133 93 33;
  --nomad-gold-wash: 239 218 181;
  --nomad-blue-glow: 63 117 186;
  --nomad-shadow: 19 43 77;
  --theme-control-radius: 0.7rem;
  --theme-surface-radius: 1rem;
  --theme-large-surface-radius: 1.5rem;
  --theme-elevation-surface: 0 18px 60px rgb(19 43 77 / 0.14), 0 2px 8px rgb(19 43 77 / 0.06);
  --theme-motion-fast: 160ms;
  --theme-motion-normal: 220ms;
}
html.dark:not(.high-contrast) {
  color-scheme: dark;
  --presentation: 8 14 26;
  --surface-primary: 11 19 33;
  --surface-primary-alt: 13 23 39;
  --surface-primary-contrast: 17 30 49;
  --surface-secondary: 17 30 49;
  --surface-secondary-alt: 21 37 58;
  --surface-tertiary: 27 45 68;
  --surface-tertiary-alt: 23 40 62;
  --surface-active: 30 52 80;
  --surface-active-alt: 36 61 91;
  --surface-hover: 30 49 75;
  --surface-hover-alt: 39 61 89;
  --surface-composer-hover: 31 50 75;
  --surface-dialog: 15 26 44;
  --surface-overlay: 2 7 15;
  --surface-chat: 23 41 66;
  --surface-code: 9 17 30;
  --header-primary: 8 14 26;
  --header-hover: 24 41 64;
  --header-button-hover: 24 41 64;
  --text-primary: 238 244 252;
  --text-secondary: 184 201 223;
  --text-secondary-alt: 172 193 220;
  --text-tertiary: 157 179 209;
  --text-muted: 151 174 205;
  --accent-primary: 132 184 245;
  --accent-primary-hover: 174 208 252;
  --surface-submit: 40 101 170;
  --surface-submit-hover: 42 109 183;
  --link: 140 190 250;
  --link-hover: 186 217 255;
  --link-visited: 190 179 244;
  --ring-primary: 216 179 122;
  --border-light: 39 58 84;
  --border-medium: 55 78 109;
  --border-medium-alt: 65 90 123;
  --border-heavy: 90 120 157;
  --border-xheavy: 127 155 190;
  --chart-widget-surface: 17 30 49;
  --chart-widget-stroke: 39 58 84;
  --nomad-gold: 216 179 122;
  --nomad-gold-wash: 216 179 122;
  --nomad-blue-glow: 68 121 190;
  --nomad-shadow: 0 4 12;
  --theme-elevation-surface: 0 22px 70px rgb(0 4 12 / 0.48), 0 2px 10px rgb(0 4 12 / 0.3);
}
html:not(.high-contrast),
html:not(.high-contrast) body {
  background-color: rgb(var(--presentation));
  color: rgb(var(--text-primary));
}
html:not(.high-contrast) #root [role="main"] {
  background-image: radial-gradient(ellipse 80% 45% at 70% 0%, rgb(var(--nomad-blue-glow) / 0.09), transparent 70%);
}
html:not(.high-contrast) ::selection {
  color: #10223c;
  background: rgb(var(--nomad-gold-wash));
}
html:not(.high-contrast) :where(button, a, input, textarea, select) {
  transition-property: background-color, border-color, box-shadow, color, opacity;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}
html:not(.high-contrast) :where(button, a, input, textarea, select):focus-visible {
  outline: 2px solid rgb(var(--ring-primary));
  outline-offset: 3px;
}
html:not(.high-contrast) :where(input, textarea)::placeholder {
  color: rgb(var(--text-muted));
  opacity: 1;
}
html:not(.high-contrast) [data-testid="composer-surface"]:not([class~="bg-series-6/10"]) {
  background-color: rgb(var(--surface-primary));
  border-color: rgb(var(--border-medium));
  box-shadow: 0 14px 48px rgb(var(--nomad-shadow) / 0.14), 0 1px 0 rgb(var(--nomad-gold) / 0.14) inset;
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
html:not(.high-contrast) [data-testid="composer-surface"]:not([class~="bg-series-6/10"]):focus-within {
  border-color: rgb(var(--ring-primary));
  box-shadow: 0 0 0 1px rgb(var(--ring-primary) / 0.3), 0 18px 60px rgb(var(--nomad-shadow) / 0.2), 0 0 32px rgb(var(--nomad-blue-glow) / 0.08);
}
html:not(.high-contrast) [data-testid="send-button"]:not(:disabled) {
  background-color: rgb(var(--surface-submit));
  color: #fff;
  box-shadow: 0 4px 12px rgb(var(--nomad-shadow) / 0.18);
}
html:not(.high-contrast) [data-testid="send-button"]:not(:disabled):hover {
  background-color: rgb(var(--surface-submit-hover));
}
html:not(.high-contrast) [data-testid^="nav-panel-"][aria-pressed="true"] {
  box-shadow: 0 0 0 1px rgb(var(--nomad-gold) / 0.38) inset;
}
html:not(.high-contrast) :where([role="dialog"], [role="menu"], [role="listbox"]) {
  border-color: rgb(var(--border-medium));
  box-shadow: var(--theme-elevation-surface);
}
html:not(.high-contrast) :where(.markdown, .prose) a {
  text-decoration: underline;
  text-decoration-color: rgb(var(--link) / 0.5);
  text-underline-offset: 3px;
}
html:not(.high-contrast) :where(.markdown, .prose) a:hover {
  text-decoration-color: currentColor;
}
img[src$="assets/logo.svg"] {
  border-radius: 8px;
  object-fit: contain;
}
img[src$="assets/nomad-symbol.svg"] {
  border-radius: 8px;
  object-fit: contain;
}
a[href^="/lab/"] {
  text-underline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html:not(.high-contrast) :where(button, a, input, textarea, select),
  html:not(.high-contrast) [data-testid="composer-surface"] {
    transition: none;
  }
}
@media (forced-colors: active) {
  html:not(.high-contrast), html:not(.high-contrast) body { background: Canvas; color: CanvasText; }
  html:not(.high-contrast) #root [role="main"] { background-image: none; }
  html:not(.high-contrast) [data-testid="composer-surface"] { border-color: ButtonBorder; box-shadow: none; }
  html:not(.high-contrast) :where(button, a, input, textarea, select):focus-visible { outline-color: Highlight; }
  html:not(.high-contrast) ::selection { color: HighlightText; background: Highlight; }
}
/* A small, accessible brand in the real chat header; no app controls move or hide. */
.nomad-chat-brand {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 116px;
  margin-right: 8px;
}
.nomad-chat-wordmark { width: 110px; height: 29px; }
.nomad-chat-symbol { display: none; }
.nomad-chat-brand > span {
  color: rgb(var(--text-secondary));
  font-size: 7px;
  font-weight: 600;
  line-height: 10px;
  letter-spacing: 0.105em;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .nomad-chat-brand { width: 28px; margin-right: 0; }
  .nomad-chat-brand .nomad-chat-wordmark,
  .nomad-chat-brand > span { display: none; }
  .nomad-chat-brand .nomad-chat-symbol { display: block; width: 28px; height: 28px; }
}
/* Same-origin artifact preview drawer. The iframe is sandboxed by both the
   panel attribute and the preview route's Content-Security-Policy. */
.nomad-preview-panel {
  position: fixed;
  z-index: 60;
  top: 64px;
  right: 16px;
  bottom: 96px;
  width: min(760px, 48vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: #0b1321;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
.nomad-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #111c2e;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}
.nomad-preview-title {
  color: #e8c27a;
  font: 600 11px/1.2 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nomad-preview-open {
  margin-left: auto;
  color: #cbd5e1;
  font: 500 12px/1.2 system-ui, -apple-system, sans-serif;
  text-decoration: none;
}
.nomad-preview-open:hover { text-decoration: underline; }
.nomad-preview-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.nomad-preview-close:hover { background: rgba(255, 255, 255, 0.08); }
.nomad-preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #ffffff;
}
@media (max-width: 900px) {
  .nomad-preview-panel {
    top: 56px;
    left: 8px;
    right: 8px;
    bottom: 88px;
    width: auto;
  }
}
/* File cards for artifacts returned by chat tools. */
.nomad-file-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 540px;
  margin-top: 4px;
}
.nomad-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(17, 28, 46, 0.78);
}
.nomad-file-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(232, 194, 122, 0.14);
  color: #e8c27a;
  font: 700 10px/1 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.06em;
}
.nomad-file-info {
  flex: 1;
  min-width: 0;
}
.nomad-file-name {
  color: #e2e8f0;
  font: 600 13px/1.3 system-ui, -apple-system, sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nomad-file-meta {
  margin-top: 2px;
  color: #94a3b8;
  font: 400 11px/1.3 system-ui, -apple-system, sans-serif;
}
.nomad-file-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}
.nomad-file-action {
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 7px;
  color: #cbd5e1;
  font: 500 11px/1 system-ui, -apple-system, sans-serif;
  text-decoration: none;
}
.nomad-file-action:hover {
  border-color: #e8c27a;
  color: #f8fafc;
}
.nomad-file-primary {
  border-color: #e8c27a;
  background: #e8c27a;
  color: #0b1321;
}
.nomad-file-primary:hover {
  background: #f0d39a;
  color: #0b1321;
}
@media (max-width: 640px) {
  .nomad-file-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .nomad-file-actions {
    width: 100%;
  }
  .nomad-file-action {
    flex: 1;
    text-align: center;
  }
}
/* Chat voice: mic button and per-message listen button. */
.nomad-voice-fab {
  position: fixed;
  right: 20px;
  bottom: 150px;
  z-index: 70;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0b1321;
  color: #e8c27a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.nomad-voice-fab.recording {
  background: #7f1d1d;
  color: #ffffff;
  animation: nomad-voice-pulse 1.2s infinite;
}
@keyframes nomad-voice-pulse {
  0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(185, 28, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}
.nomad-voice-play {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(17, 28, 46, 0.78);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 4px 10px;
  font: 500 11px/1.3 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  margin-top: 6px;
}
.nomad-voice-play:hover {
  border-color: #e8c27a;
  color: #f8fafc;
}
.nomad-voice-play.speaking,
.nomad-voice-play.playing {
  color: #e8c27a;
  border-color: rgba(232, 194, 122, 0.55);
}
