:root {
  --np-bg: #071018;
  --np-surface: #0c1822;
  --np-surface-2: #12212d;
  --np-border: rgba(190, 223, 232, .14);
  --np-text: #f6fbfd;
  --np-muted: #9cb0bc;
  --np-accent: #65e6d0;
  --np-accent-strong: #22c9ad;
  --np-focus: #a9fff0;
}

.nexopulse-root, .nexopulse-root * { box-sizing: border-box; }
.nexopulse-root {
  position: fixed; inset: 0; z-index: 2147483000; pointer-events: none;
  color: var(--np-text); font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.nexopulse-root button, .nexopulse-root textarea, .nexopulse-root select, .nexopulse-root input { font: inherit; }
.nexopulse-root button { color: inherit; }
.nexopulse-root button:focus-visible, .nexopulse-root textarea:focus-visible,
.nexopulse-root select:focus-visible, .nexopulse-root input:focus-visible {
  outline: 2px solid var(--np-focus); outline-offset: 2px;
}
.nexopulse-root .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.nexopulse-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483647; width: 56px; height: 56px;
  display: grid; place-items: center; pointer-events: auto; cursor: pointer; border: 1px solid rgba(101,230,208,.5);
  border-radius: 18px; background: #0b1c25; color: var(--np-accent); box-shadow: 0 14px 38px rgba(0,0,0,.45);
  font-size: 23px; font-weight: 800; transition: transform 160ms ease, background 160ms ease;
}
.nexopulse-launcher:hover { transform: translateY(-2px); background: #102832; }
.nexopulse-root[data-state="open"] .nexopulse-launcher,
.nexopulse-root[data-state="expanded"] .nexopulse-launcher { opacity: 0; visibility: hidden; pointer-events: none; }

.nexopulse-shell {
  position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(420px, calc(100vw - 24px));
  display: grid; grid-template-rows: auto minmax(120px, 1fr) auto auto; overflow: hidden;
  pointer-events: auto; border: 1px solid var(--np-border); border-radius: 24px; background: var(--np-bg);
  box-shadow: 0 24px 80px rgba(0,0,0,.55); transform: translateX(calc(100% + 28px)); opacity: 0;
  visibility: hidden; transition: transform 180ms ease, opacity 160ms ease, width 180ms ease; isolation: isolate;
}
.nexopulse-root[data-state="open"] .nexopulse-shell,
.nexopulse-root[data-state="expanded"] .nexopulse-shell { transform: translateX(0); opacity: 1; visibility: visible; }
.nexopulse-root[data-state="expanded"] .nexopulse-shell { width: min(760px, calc(100vw - 24px)); }
.nexopulse-root[data-state="closed"] .nexopulse-shell,
.nexopulse-root[data-state="retracted"] .nexopulse-shell { pointer-events: none; }

.nexopulse-header { min-height: 64px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--np-border); background: rgba(12,24,34,.96); overflow: hidden; }
.nexopulse-identity { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.nexopulse-brand { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 13px; background: rgba(101,230,208,.1); color: var(--np-accent); font-weight: 800; }
.nexopulse-identity > span:nth-child(2) { min-width: 0; flex: 1 1 auto; display: grid; gap: 2px; overflow: hidden; }
.nexopulse-identity strong { font-size: 14px; letter-spacing: .01em; }
.nexopulse-identity small { display: block; min-width: 0; color: var(--np-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nexopulse-language-current { flex: 0 1 auto; max-width: 78px; min-width: 0; padding: 7px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border: 0; border-radius: 10px; background: rgba(101,230,208,.08); color: var(--np-accent) !important; font-size: 10px !important; }
.nexopulse-header-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.nexopulse-icon-button, .nexopulse-compose-button { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; cursor: pointer; border: 0; border-radius: 10px; background: transparent; font-size: 17px; }
.nexopulse-icon-button:hover, .nexopulse-compose-button:hover { background: rgba(255,255,255,.07); }
.nexopulse-root[data-state="expanded"] .nexopulse-language-current { max-width: 110px; }
.nexopulse-root[data-state="expanded"] .nexopulse-header { gap: 10px; }


.nexopulse-conversation { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 20px; scrollbar-width: thin; }
.nexopulse-welcome { min-height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; }
.nexopulse-welcome-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 18px; background: rgba(101,230,208,.1); color: var(--np-accent); font-size: 20px; font-weight: 800; }
.nexopulse-welcome h2 { margin: 0; font-size: 20px; font-weight: 650; }
.nexopulse-welcome p { max-width: 290px; margin: 8px 0 0; color: var(--np-muted); font-size: 12px; line-height: 1.55; }

.nexopulse-user-avatar {
  width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center;
  border: 1px solid rgba(101,230,208,.35); border-radius: 50%;
  background: rgba(101,230,208,.12); color: var(--np-accent); font-size: 10px; font-weight: 800;
}
.nexopulse-message { display: flex; align-items: flex-start; gap: 8px; max-width: 92%; margin: 0 0 14px; }
.nexopulse-message--user { margin-left: auto; flex-direction: row-reverse; }
.nexopulse-message-avatar {
  width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(101,230,208,.12); color: var(--np-accent);
  font-size: 9px; font-weight: 800;
}
.nexopulse-message--user .nexopulse-message-avatar { background: rgba(255,255,255,.08); color: var(--np-text); }
.nexopulse-message-body {
  min-width: 0; padding: 9px 11px; border: 1px solid var(--np-border);
  border-radius: 4px 14px 14px 14px; background: var(--np-surface);
}
.nexopulse-message--user .nexopulse-message-body {
  border-color: rgba(101,230,208,.24); border-radius: 14px 4px 14px 14px;
  background: rgba(34,201,173,.12);
}
.nexopulse-message-body strong { display: block; margin-bottom: 3px; color: var(--np-muted); font-size: 9px; }
.nexopulse-message-body p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 12px; line-height: 1.5; }
.nexopulse-processing {
  display: flex; align-items: center; gap: 8px; width: max-content; padding: 8px 10px;
  border-radius: 12px; background: var(--np-surface); color: var(--np-muted); font-size: 10px;
}
.nexopulse-processing span { width: 8px; height: 8px; border-radius: 50%; background: var(--np-accent); animation: npPulse 1.1s ease-in-out infinite; }
.nexopulse-conversation-error {
  margin: 8px 0 14px; padding: 9px 11px; border: 1px solid rgba(255,125,139,.36);
  border-radius: 11px; background: rgba(200,71,85,.1); color: #ffb7bf; font-size: 10px; line-height: 1.45;
}
.nexopulse-root[data-pending="true"] .nexopulse-send { cursor: wait; opacity: .65; }
.nexopulse-draft-label textarea:disabled { cursor: wait; opacity: .72; }

.nexopulse-secondary { border-top: 1px solid var(--np-border); background: var(--np-surface); max-height: min(46vh, 360px); overflow-y: auto; }
.nexopulse-option + .nexopulse-option { border-top: 1px solid rgba(190,223,232,.08); }
.nexopulse-option-trigger { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 14px; cursor: pointer; border: 0; background: transparent; text-align: left; }
.nexopulse-option-trigger:hover { background: rgba(255,255,255,.035); }
.nexopulse-option-trigger > span:first-child { min-width: 0; display: grid; gap: 1px; }
.nexopulse-option-trigger strong { font-size: 11px; font-weight: 600; }
.nexopulse-option-trigger small { color: var(--np-muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nexopulse-chevron { color: var(--np-muted); transition: transform 140ms ease; }
.nexopulse-option-trigger[aria-expanded="true"] .nexopulse-chevron { transform: rotate(180deg); }
.nexopulse-option-content { padding: 4px 14px 14px; color: var(--np-muted); font-size: 11px; }
.nexopulse-option-content[hidden] { display: none; }
.nexopulse-quick-languages, .nexopulse-media-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.nexopulse-choice, .nexopulse-media-actions button, .nexopulse-text-button { min-height: 32px; padding: 7px 10px; cursor: pointer; border: 1px solid var(--np-border); border-radius: 10px; background: var(--np-surface-2); font-size: 10px !important; }
.nexopulse-choice[aria-pressed="true"] { border-color: var(--np-accent); color: var(--np-accent); }
.nexopulse-text-button { margin-top: 8px; background: transparent; color: var(--np-accent) !important; }
.nexopulse-field { display: grid; gap: 5px; margin-top: 10px; }
.nexopulse-field select { width: 100%; padding: 8px; border: 1px solid var(--np-border); border-radius: 9px; background: var(--np-surface-2); color: var(--np-text); }
.nexopulse-check, .nexopulse-switch { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--np-text); }
.nexopulse-help { margin: 9px 0 0; line-height: 1.45; }
.nexopulse-human-status { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 5px 0; }
.nexopulse-human-status > span { grid-row: span 2; color: var(--np-accent); }
.nexopulse-human-status small { color: var(--np-muted); }

.nexopulse-attachment-list { display: grid; gap: 7px; margin-top: 9px; }
.nexopulse-attachment-item { min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px; border-radius: 10px; background: rgba(255,255,255,.035); }
.nexopulse-attachment-item img, .nexopulse-attachment-item video { width: 42px; height: 42px; object-fit: cover; border-radius: 7px; }
.nexopulse-attachment-item audio { width: 42px; height: 32px; }
.nexopulse-attachment-item > span, .nexopulse-attachment-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexopulse-remove-attachment { width: 28px; height: 28px; cursor: pointer; border: 0; border-radius: 8px; background: rgba(255,255,255,.06); }

.nexopulse-composer { position: relative; z-index: 3; padding: 10px 12px 11px; border-top: 1px solid var(--np-border); background: #0b171f; }
.nexopulse-composer-top { display: flex; gap: 5px; overflow-x: auto; }
.nexopulse-composer-top:empty { display: none; }
.nexopulse-attachment-chip { max-width: 155px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px; margin-bottom: 7px; padding: 4px 5px 4px 8px; border-radius: 9px; background: var(--np-surface-2); color: var(--np-muted); font-size: 9px; }
.nexopulse-composer-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: end; gap: 5px; }
.nexopulse-draft-label { min-width: 0; display: block; }
.nexopulse-draft-label textarea { width: 100%; min-height: 38px; max-height: 132px; display: block; resize: none; overflow-y: auto; padding: 9px 11px; border: 1px solid var(--np-border); border-radius: 13px; background: var(--np-surface-2); color: var(--np-text); line-height: 1.4; }
.nexopulse-draft-label textarea::placeholder { color: #8195a1; }
.nexopulse-send { width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; border: 0; border-radius: 13px; background: var(--np-accent-strong); color: #03120f !important; font-size: 16px; }
.nexopulse-mic { color: var(--np-muted) !important; }
.nexopulse-recording .nexopulse-mic { background: #c84755; color: white !important; animation: npPulse 1.2s ease-in-out infinite; }
.nexopulse-feedback { min-height: 14px; margin: 6px 4px 0; color: var(--np-muted); font-size: 9px; line-height: 1.35; }
.nexopulse-cancel-recording { padding: 3px 4px; cursor: pointer; border: 0; background: transparent; color: #ff9ca6 !important; font-size: 9px !important; }
.nexopulse-file-input { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Historical modules remain available internally but are not part of the user-facing conversation. */
.nexopulse-root [data-nexopulse-canonical-section],
.nexopulse-root .nexopulse-language-services-ui,
.nexopulse-root .nexopulse-accessibility-preferences-ui,
.nexopulse-root .nexopulse-attachments-media-ui,
.nexopulse-root .nexopulse-upload-governance-ui,
.nexopulse-root .nexopulse-privacy-contact-ui,
.nexopulse-root .nexopulse-privacy-user-controls-ui,
.nexopulse-root .nexopulse-contact-inbox-ui,
.nexopulse-root .nexopulse-relationship-trust-ui,
.nexopulse-root .nexopulse-reputation-adm-ui,
.nexopulse-root .nexopulse-governance-consolidation-ui { display: none !important; }

.nexopulse-high-contrast { --np-bg: #000; --np-surface: #050505; --np-surface-2: #111; --np-border: rgba(255,255,255,.46); --np-text: #fff; --np-muted: #ddd; --np-accent: #7dffe9; }
.nexopulse-large-text .nexopulse-shell { font-size: 112%; }
.nexopulse-reduce-motion *, .nexopulse-reduce-motion *::before, .nexopulse-reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@keyframes npPulse { 50% { box-shadow: 0 0 0 5px rgba(200,71,85,.2); } }

@media (max-width: 720px) {
  .nexopulse-shell,
  .nexopulse-root[data-state="expanded"] .nexopulse-shell { inset: 0; width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .nexopulse-launcher { right: 14px; bottom: 14px; }
  .nexopulse-secondary { max-height: min(42vh, 320px); }
}
@media (max-width: 390px) {
  .nexopulse-header { gap: 4px; padding-inline: 6px; }
  .nexopulse-brand { width: 32px; height: 32px; flex-basis: 32px; }
  .nexopulse-user-avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .nexopulse-identity small { display: none; }
  .nexopulse-language-current { max-width: 58px; padding-inline: 5px; }
  .nexopulse-icon-button { width: 29px; height: 29px; flex-basis: 29px; font-size: 16px; }
  .nexopulse-composer { padding-inline: 8px; }
  .nexopulse-composer-row { gap: 3px; }
  .nexopulse-compose-button { width: 32px; }
  .nexopulse-send { width: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .nexopulse-root *, .nexopulse-root *::before, .nexopulse-root *::after { animation: none !important; transition-duration: .01ms !important; }
}
.nexopulse-search-label { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 12px; }
.nexopulse-search-label select { color: inherit; background: #15202f; border: 1px solid #64748b; border-radius: 6px; padding: 5px; }
.nexopulse-message-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.nexopulse-message-sources a { color: #79caff; text-decoration: underline; overflow-wrap: anywhere; }
