/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/**
 * 1. Set default font family to sans-serif.
 * 2. Prevent iOS and IE text size adjust after device orientation change,
 *    without disabling user zoom.
 */
html {
  font-family: sans-serif;
  /* 1 */
  -ms-text-size-adjust: 100%;
  /* 2 */
  -webkit-text-size-adjust: 100%;
  /* 2 */
}
/**
 * Remove default margin.
 */
body {
  margin: 0;
}
/* HTML5 display definitions
   ========================================================================== */
/**
 * Correct `block` display not defined for any HTML5 element in IE 8/9.
 * Correct `block` display not defined for `details` or `summary` in IE 10/11
 * and Firefox.
 * Correct `block` display not defined for `main` in IE 11.
 */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
  display: block;
}
/**
 * 1. Correct `inline-block` display not defined in IE 8/9.
 * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
 */
audio,
canvas,
progress,
video {
  display: inline-block;
  /* 1 */
  vertical-align: baseline;
  /* 2 */
}
/**
 * Prevent modern browsers from displaying `audio` without controls.
 * Remove excess height in iOS 5 devices.
 */
audio:not([controls]) {
  display: none;
  height: 0;
}
/**
 * Address `[hidden]` styling not present in IE 8/9/10.
 * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
 */
[hidden],
template {
  display: none;
}
/* Links
   ========================================================================== */
/**
 * Remove the gray background color from active links in IE 10.
 */
a {
  background-color: transparent;
}
/**
 * Improve readability of focused elements when they are also in an
 * active/hover state.
 */
a:active,
a:hover {
  outline: 0;
}
/* Text-level semantics
   ========================================================================== */
/**
 * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
 */
abbr[title] {
  border-bottom: 1px dotted;
}
/**
 * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
 */
b,
strong {
  font-weight: bold;
}
/**
 * Address styling not present in Safari and Chrome.
 */
dfn {
  font-style: italic;
}
/**
 * Address variable `h1` font-size and margin within `section` and `article`
 * contexts in Firefox 4+, Safari, and Chrome.
 */
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}
/**
 * Address styling not present in IE 8/9.
 */
mark {
  background: #ff0;
  color: #000;
}
/**
 * Address inconsistent and variable font size in all browsers.
 */
small {
  font-size: 80%;
}
/**
 * Prevent `sub` and `sup` affecting `line-height` in all browsers.
 */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup {
  top: -0.5em;
}
sub {
  bottom: -0.25em;
}
/* Embedded content
   ========================================================================== */
/**
 * Remove border when inside `a` element in IE 8/9/10.
 */
img {
  border: 0;
}
/**
 * Correct overflow not hidden in IE 9/10/11.
 */
svg:not(:host) {
  overflow: hidden;
}
/* Grouping content
   ========================================================================== */
/**
 * Address margin not present in IE 8/9 and Safari.
 */
figure {
  margin: 1em 40px;
}
/**
 * Address differences between Firefox and other browsers.
 */
hr {
  box-sizing: content-box;
  height: 0;
}
/**
 * Contain overflow in all browsers.
 */
pre {
  overflow: auto;
}
/**
 * Address odd `em`-unit font size rendering in all browsers.
 */
code,
kbd,
pre,
samp {
  font-family: monospace, monospace;
  font-size: 1em;
}
/* Forms
   ========================================================================== */
/**
 * Known limitation: by default, Chrome and Safari on OS X allow very limited
 * styling of `select`, unless a `border` property is set.
 */
/**
 * 1. Correct color not being inherited.
 *    Known issue: affects color of disabled elements.
 * 2. Correct font properties not being inherited.
 * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
 */
button,
input,
optgroup,
select,
textarea {
  color: inherit;
  /* 1 */
  font: inherit;
  /* 2 */
  margin: 0;
  /* 3 */
}
/**
 * Address `overflow` set to `hidden` in IE 8/9/10/11.
 */
button {
  overflow: visible;
}
/**
 * Address inconsistent `text-transform` inheritance for `button` and `select`.
 * All other form control elements do not inherit `text-transform` values.
 * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
 * Correct `select` style inheritance in Firefox.
 */
button,
select {
  text-transform: none;
}
/**
 * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
 *    and `video` controls.
 * 2. Correct inability to style clickable `input` types in iOS.
 * 3. Improve usability and consistency of cursor style between image-type
 *    `input` and others.
 * 4. CUSTOM FOR WEBFLOW: Removed the input[type="submit"] selector to reduce
 *    specificity and defer to the .w-button selector
 */
button,
html input[type="button"],
input[type="reset"] {
  -webkit-appearance: button;
  /* 2 */
  cursor: pointer;
  /* 3 */
}
/**
 * Re-set default cursor for disabled elements.
 */
button[disabled],
html input[disabled] {
  cursor: default;
}
/**
 * Remove inner padding and border in Firefox 4+.
 */
button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}
/**
 * Address Firefox 4+ setting `line-height` on `input` using `!important` in
 * the UA stylesheet.
 */
input {
  line-height: normal;
}
/**
 * It's recommended that you don't attempt to style these elements.
 * Firefox's implementation doesn't respect box-sizing, padding, or width.
 *
 * 1. Address box sizing set to `content-box` in IE 8/9/10.
 * 2. Remove excess padding in IE 8/9/10.
 */
input[type='checkbox'],
input[type='radio'] {
  box-sizing: border-box;
  /* 1 */
  padding: 0;
  /* 2 */
}
/**
 * Fix the cursor style for Chrome's increment/decrement buttons. For certain
 * `font-size` values of the `input`, it causes the cursor style of the
 * decrement button to change from `default` to `text`.
 */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  height: auto;
}
/**
 * 1. CUSTOM FOR WEBFLOW: changed from `textfield` to `none` to normalize iOS rounded input
 * 2. CUSTOM FOR WEBFLOW: box-sizing: content-box rule removed
 *    (similar to normalize.css >=4.0.0)
 */
input[type='search'] {
  -webkit-appearance: none;
  /* 1 */
}
/**
 * Remove inner padding and search cancel button in Safari and Chrome on OS X.
 * Safari (but not Chrome) clips the cancel button when the search input has
 * padding (and `textfield` appearance).
 */
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
}
/**
 * Define consistent border, margin, and padding.
 */
fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}
/**
 * 1. Correct `color` not being inherited in IE 8/9/10/11.
 * 2. Remove padding so people aren't caught out if they zero out fieldsets.
 */
legend {
  border: 0;
  /* 1 */
  padding: 0;
  /* 2 */
}
/**
 * Remove default vertical scrollbar in IE 8/9/10/11.
 */
textarea {
  overflow: auto;
}
/**
 * Don't inherit the `font-weight` (applied by a rule above).
 * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
 */
optgroup {
  font-weight: bold;
}
/* Tables
   ========================================================================== */
/**
 * Remove most spacing between table cells.
 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}
td,
th {
  padding: 0;
}

:host {
  /* Brand Core Colors */
  --base-color-brand--burn: #D84315;
  --base-color-brand--burst: #FF5722; /* Vibrant Orange */
  --base-color-brand--glow: #2979FF; /* Electric Blue */
  --base-color-brand--mood-dust: #9e9e9e; /* Grey text */
  --base-color-brand--void: #050505; /* Deep Black Background */
  --base-color-brand--surface: #121212; /* Dark Charcoal Surface */
  --base-color-brand--void-50: rgba(255, 255, 255, 0.1); /* Subtle borders */
  
  /* Neutral Colors */
  --base-color-neutral--white: #ffffff;
  --base-color-neutral--black: #000000;
  --base-color-neutral--neutral-light: #888888;
  --base-color-neutral--neutral-dark: #2c2c2c;
  --base-color-neutral--neutral-darkest: #1a1a1a;
  --base-color-neutral--neutral-lightest: #f5f5f5;

  /* System Colors */
  --base-color-system--error-red: #ff453a;
  --base-color-system--error-red-light: rgba(255, 69, 58, 0.1);
  --base-color-system--success-green: #30d158;
  --base-color-system--success-green-light: rgba(48, 209, 88, 0.1);

  /* Theme Mapping */
  --_theme---background-color--background-primary: var(--base-color-brand--void);
  --_theme---background-color--background-secondary: var(--base-color-brand--surface);
  --_theme---background-color--background-tertiary: var(--base-color-neutral--neutral-darkest);
  --_theme---background-color--background-white: var(--base-color-neutral--white);
  --_theme---background-color--background-glass: rgba(18, 18, 18, 0.6);
  --_theme---background-color--input-background: var(--base-color-neutral--neutral-darkest);
  --_theme---background-color--background-error: var(--base-color-system--error-red-light);
  --_theme---background-color--background-success: var(--base-color-system--success-green-light);

  --_theme---border-color--border-primary: var(--base-color-brand--void-50);
  --_theme---border-color--border-input: var(--base-color-brand--void-50);
  --_theme---border-color--border-alternate: var(--base-color-neutral--neutral-dark);
  --_theme---border-color--border-active: var(--base-color-brand--burst);

  --_theme---text-color--text-primary: var(--base-color-neutral--white);
  --_theme---text-color--text-secondary: var(--base-color-neutral--neutral-light);
  --_theme---text-color--text-alternate: var(--base-color-brand--mood-dust);
  --_theme---text-color--text-error: var(--base-color-system--error-red);
  --_theme---text-color--text-success: var(--base-color-system--success-green);
  --_theme---text-color--text-placeholder-light: rgba(255, 255, 255, 0.3);
  --_theme---text-color--text-placeholder-dark: rgba(255, 255, 255, 0.5);

  --_theme---link-color--link-primary: var(--base-color-brand--glow);
  --_theme---link-color--link-secondary: var(--base-color-neutral--neutral-light);
  --_theme---link-color--link-alternate: var(--base-color-neutral--white);
}

body {
  font-family: "Inter", "Interdisplay", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--_theme---background-color--background-primary);
  color: var(--_theme---text-color--text-primary);
}

.lead-agent-chat {
  border: 1px solid var(--base-color-brand--void-50);
  border-radius: 1rem;
  background: var(--base-color-brand--void);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--base-color-neutral--white);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.8);
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 85vh; /* Fixed height relative to viewport to force scrolling */
  min-height: 600px;
  position: relative;
  overflow: hidden;
  font-smoothing: antialiased;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   SIDEBAR
   ============================================ */

.lead-agent-chat__sidebar {
  background: var(--base-color-brand--surface);
  border-right: 1px solid var(--base-color-brand--void-50);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.lead-agent-chat__sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lead-agent-chat__agent-selector {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--base-color-brand--void);
  border: 1px solid var(--base-color-brand--void-50);
  border-radius: 0.5rem;
  color: var(--base-color-neutral--white);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27white%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3e%3cpolyline points=%276 9 12 15 18 9%27%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.lead-agent-chat__agent-selector:hover,
.lead-agent-chat__agent-selector:focus {
  border-color: var(--base-color-brand--burst);
}

.lead-agent-chat__new-thread-btn {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--base-color-brand--burst);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: var(--base-color-neutral--white);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}

.lead-agent-chat__new-thread-btn:hover {
  background: #E64A19;
  transform: translateY(-1px);
}

.lead-agent-chat__new-thread-btn:active {
  transform: translateY(0);
}

.lead-agent-chat__new-thread-icon {
  width: 16px;
  height: 16px;
}

/* ============================================
   THREAD LIST
   ============================================ */

.lead-agent-chat__thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.lead-agent-chat__thread-list::-webkit-scrollbar {
  width: 4px;
}

.lead-agent-chat__thread-list::-webkit-scrollbar-track {
  background: transparent;
}

.lead-agent-chat__thread-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.lead-agent-chat__threads-loading,
.lead-agent-chat__threads-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--base-color-neutral--neutral-light);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lead-agent-chat__loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--base-color-brand--burst);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

/* Thread item */
.lead-agent-chat__thread-item {
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.25rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 150ms ease;
  border: 1px solid transparent;
  color: var(--base-color-neutral--neutral-light);
}

.lead-agent-chat__thread-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--base-color-neutral--white);
}

.lead-agent-chat__thread-item--active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--base-color-neutral--white);
  border-color: rgba(255, 255, 255, 0.05);
}

.lead-agent-chat__thread-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-agent-chat__thread-meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   MAIN CHAT AREA
   ============================================ */

.lead-agent-chat__main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: var(--base-color-brand--void);
  overflow: hidden; /* Stops container from growing with content */
}

/* Empty state - centered welcome screen */
.lead-agent-chat__empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2rem;
  padding: 2rem;
  animation: fadeIn 0.6s ease-out;
  overflow-y: auto; /* Allow scrolling if empty state is tall */
}

.lead-agent-chat__sparkle-icon {
  width: 64px;
  height: 64px;
  color: var(--base-color-brand--glow);
  opacity: 1;
  filter: drop-shadow(0 0 20px rgba(41, 121, 255, 0.3));
}

.lead-agent-chat__sparkle-icon--animated {
  animation: sparklePulse 3s ease-in-out infinite;
}

.lead-agent-chat__welcome-text {
  font-family: "Interdisplay", "Inter", sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--base-color-neutral--white);
  text-align: center;
  margin: 0;
  max-width: 500px;
  background: linear-gradient(135deg, #fff 0%, #aaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead-agent-chat__heading {
  display: none;
}

.lead-agent-chat__label {
  display: none;
}

/* ============================================
   MESSAGE TRANSCRIPT
   ============================================ */

.lead-agent-chat__transcript {
  flex: 1 1 auto;
  width: 100%;
  height: 100%; /* Reinforce size constraint */
  min-height: 0;
  overflow-y: auto;
  padding: 2rem 0 1rem; /* Horizontal padding moved to message container */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.lead-agent-chat__transcript::-webkit-scrollbar {
  width: 6px;
}

.lead-agent-chat__transcript::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Container for message content to limit width and center it */
.lead-agent-chat__message-container {
  width: 100%;
  max-width: 800px; /* Claude-like width constraint */
  margin: 0 auto;
  padding: 0 1rem; /* Interior padding to prevent edge bumping */
  display: flex;
  flex-direction: column;
}

/* ============================================
   MESSAGES
   ============================================ */

.lead-agent-chat__message {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  border: none;
  max-width: 100%;
  width: 100%;
  animation: messageSlideIn 0.3s ease-out forwards;
}

/* Assistant Message Style */
.lead-agent-chat__message--assistant {
  align-items: flex-start;
}

/* User Message Style */
.lead-agent-chat__message--user {
  align-items: flex-end;
}

.lead-agent-chat__message-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--base-color-neutral--neutral-light);
  margin-bottom: 0.25rem;
  padding: 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lead-agent-chat__message-text {
  font-size: 1rem;
  line-height: 1.6;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: anywhere; /* Better line breaking for long strings/URLs */
}

/* User Bubble */
.lead-agent-chat__message--user .lead-agent-chat__message-text {
  background: var(--base-color-neutral--neutral-darkest);
  color: var(--base-color-neutral--white);
  padding: 0.75rem 1rem;
  border-radius: 1rem 1rem 0 1rem;
  border: 1px solid var(--base-color-brand--void-50);
  max-width: 85%; /* Limit user bubble width */
  text-align: left;
}

/* Assistant Bubble (Minimalist, text-focused) */
.lead-agent-chat__message--assistant .lead-agent-chat__message-text {
  background: transparent;
  color: var(--base-color-neutral--white);
  padding: 0 0.5rem; /* Slight padding for alignment */
  width: 100%;
}

/* ============================================
   COMPOSER (INPUT AREA)
   ============================================ */

.lead-agent-chat__composer-wrapper {
  flex: 0 0 auto; /* Don't shrink */
  padding: 1rem 1rem 2rem; /* Bottom padding for spacing */
  background: linear-gradient(to top, var(--base-color-brand--void) 80%, rgba(5, 5, 5, 0));
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.lead-agent-chat__composer {
  display: flex;
  align-items: flex-end; /* Align bottom for multiline */
  gap: 0.75rem;
  background: var(--base-color-brand--surface);
  border: 1px solid var(--base-color-brand--void-50);
  border-radius: 1.5rem;
  padding: 0.75rem 1rem;
  transition: all 200ms ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.lead-agent-chat__composer:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  background: #1a1a1a;
}

.lead-agent-chat__composer-icon {
  width: 20px;
  height: 20px;
  color: var(--base-color-brand--glow);
  flex-shrink: 0;
  margin-bottom: 0.5rem; /* Align with single line text */
}

.lead-agent-chat__input--message {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  padding: 0.5rem 0;
  color: var(--base-color-neutral--white);
  font-size: 1rem;
  line-height: 1.5;
  resize: none; /* If we switch to textarea */
  min-height: 24px;
}

.lead-agent-chat__input--message:focus {
  outline: none;
}

.lead-agent-chat__input--message::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Submit button */
.lead-agent-chat__submit {
  border: none;
  border-radius: 0.5rem;
  background: var(--base-color-brand--burst);
  color: white;
  padding: 0.35rem;
  cursor: pointer;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.15rem;
  width: 32px;
  height: 32px;
}

.lead-agent-chat__submit:hover:not(:disabled) {
  background: #E64A19;
  transform: scale(1.05);
}

.lead-agent-chat__submit:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
}

.lead-agent-chat__submit-icon {
  width: 18px;
  height: 18px;
}

/* Stop button */
.lead-agent-chat__stop-btn {
  border: none;
  border-radius: 0.5rem;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 0.35rem;
  cursor: pointer;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.15rem;
  width: 32px;
  height: 32px;
}

.lead-agent-chat__stop-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   TYPING INDICATOR
   ============================================ */

.lead-agent-chat__typing-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Align left */
  gap: 6px;
  padding: 0.5rem 0.5rem; /* Add padding to match text bubble */
  min-height: 24px;
}

.lead-agent-chat__typing-dot {
  width: 6px;
  height: 6px;
  background: var(--base-color-brand--burst);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
  opacity: 0.7;
}

/* ============================================
   MARKDOWN & CODE STYLING
   ============================================ */

.markdown-block h1,
.markdown-block h2,
.markdown-block h3 {
  color: var(--base-color-neutral--white);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.markdown-block a {
  color: var(--base-color-brand--glow);
  text-decoration: none;
  border-bottom: 1px solid rgba(41, 121, 255, 0.3);
}

.markdown-block a:hover {
  border-bottom-color: var(--base-color-brand--glow);
}

.markdown-block code {
  background: rgba(255, 255, 255, 0.1);
  color: var(--base-color-brand--burst);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.code-block {
  border: 1px solid var(--base-color-brand--void-50);
  border-radius: 0.75rem;
  background: #0d0d0d;
}

.code-block pre {
  background: #0d0d0d !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spinnerRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes sparklePulse {
  0%, 100% { 
    opacity: 0.8;
    transform: scale(1);
    filter: drop-shadow(0 0 15px rgba(41, 121, 255, 0.2));
  }
  50% { 
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 25px rgba(41, 121, 255, 0.5));
  }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   MOBILE HEADER & ICONS
   ============================================ */

.lead-agent-chat__mobile-header {
  display: none; /* Hidden on desktop */
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--base-color-brand--void);
  border-bottom: 1px solid var(--base-color-brand--void-50);
  height: 60px;
  flex-shrink: 0;
}

.lead-agent-chat__mobile-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--base-color-neutral--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-agent-chat__menu-btn,
.lead-agent-chat__mobile-new-thread,
.lead-agent-chat__mobile-close {
  background: transparent;
  border: none;
  color: var(--base-color-neutral--neutral-light);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.lead-agent-chat__menu-btn:hover,
.lead-agent-chat__mobile-new-thread:hover,
.lead-agent-chat__mobile-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--base-color-neutral--white);
}

/* Close button for sidebar on mobile */
.lead-agent-chat__mobile-close {
  display: none; /* Hidden on desktop */
  margin-bottom: 1rem;
  align-self: flex-end;
}

.lead-agent-chat__icon-md {
  width: 24px;
  height: 24px;
}

.lead-agent-chat__icon-sm {
  width: 20px;
  height: 20px;
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */

.lead-agent-chat__mobile-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 15;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .lead-agent-chat {
    grid-template-columns: 1fr;
    border-radius: 0;
    /* Use dvh for actual viewport height on mobile browsers */
    height: 100dvh; 
    max-height: 100dvh;
    border: none;
  }

  /* Main Area Changes */
  .lead-agent-chat__main {
    padding: 0;
    width: 100%;
  }

  .lead-agent-chat__mobile-header {
    display: flex; /* Show on mobile */
  }

  .lead-agent-chat__mobile-overlay {
    display: block; /* Enabled logic handles conditional rendering in React */
  }

  /* Sidebar - Slide-out Drawer */
  .lead-agent-chat__sidebar {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 300px;
    z-index: 20;
    background: var(--base-color-brand--surface);
    border-right: 1px solid var(--base-color-brand--void-50);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .lead-agent-chat__sidebar--open {
    transform: translateX(0);
  }

  .lead-agent-chat__mobile-close {
    display: flex; /* Show inside sidebar on mobile */
  }

  /* Adjust padding inside sidebar */
  .lead-agent-chat__sidebar-header {
    padding-top: 1rem;
  }

  /* Chat Area Adjustments */
  .lead-agent-chat__transcript {
    padding: 1rem 0;
  }
  
  .lead-agent-chat__composer-wrapper {
    padding: 0.75rem;
    background: var(--base-color-brand--void); /* Solid background on mobile usually better */
    border-top: 1px solid var(--base-color-brand--void-50);
  }

  /* Message bubbles can be slightly wider on mobile */
  .lead-agent-chat__message--user .lead-agent-chat__message-text {
    max-width: 90%;
  }
}

