/* ══════════════════════════════════════════════════════════
   MEMAERO — AI CONCIERGE  ·  Elite UI  ·  2026
   Premium FPV conversion surface — charcoal + red, warm neutral
   All tokens resolve against memaero-tokens.css with concrete fallbacks.
   ══════════════════════════════════════════════════════════ */

/* ── Local token map ── */
.ma-chat-panel,
.ma-chat-tab,
.ma-chat-overlay {
  --ma-primary:          var(--brand-primary,       #C8102E);
  --ma-primary-hover:    var(--brand-primary-hover, #A50D26);
  --ma-primary-muted:    rgba(200, 16, 46, 0.09);
  --ma-primary-muted2:   rgba(200, 16, 46, 0.15);

  --ma-dark:             var(--brand-dark,      #1F2124);
  --ma-dark-mid:         var(--brand-mid,       #2E3236);

  --ma-bg:               var(--bg-page,         #F2EFEA);
  --ma-surface:          #FFFFFF;
  --ma-surface-warm:     var(--bg-surface,      #F8F5F0);
  --ma-surface-elevated: var(--bg-surface-dark, #EDEAE4);

  --ma-text:             var(--text-primary,    #1F2124);
  --ma-text-secondary:   var(--text-secondary,  #69727D);
  --ma-text-muted:       var(--text-light,      #9DA5AE);
  --ma-text-on-dark:     var(--text-on-dark,    #F2EFEA);

  --ma-border:           #ECE6DC;
  --ma-border-strong:    var(--border,          #D0CBC4);

  --ma-font-display:     var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  --ma-font-body:        var(--font-body,    'Inter', system-ui, sans-serif);
  --ma-font-mono:        var(--font-mono,    ui-monospace, 'SF Mono', Menlo, monospace);

  --ma-ease-out:         var(--ease-out,      cubic-bezier(0.16, 1, 0.3, 1));
  --ma-ease-spring:      cubic-bezier(0.34, 1.56, 0.64, 1);
  --ma-duration-fast:    var(--duration-fast, 150ms);
  --ma-duration-med:     var(--duration-base, 250ms);

  --ma-radius-sm:        var(--radius-sm,  4px);
  --ma-radius-md:        var(--radius-md,  8px);
  --ma-radius-lg:        var(--radius-lg,  12px);
  --ma-radius-xl:        20px;
  --ma-radius-pill:      999px;

  --ma-error:            var(--color-error, #EF4444);

  /* Panel shadow — layered for depth */
  --ma-panel-shadow: -6px 0 20px rgba(31,33,36,0.10),
                     -2px 0 6px  rgba(31,33,36,0.06),
                      0 0 0 1px  rgba(31,33,36,0.04);
}


/* ════════════════════════════════════════════════════════
   LAUNCHER TAB
   ════════════════════════════════════════════════════════ */
.ma-chat-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  z-index: 9999;
  background: var(--ma-primary);
  color: #fff;
  border: none;
  border-right: none;
  padding: 18px 13px;
  box-shadow: -3px 0 16px rgba(200, 16, 46, 0.35),
               0  0  0   1px rgba(200, 16, 46, 0.15) inset;
  font-family: var(--ma-font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 10px 0 0 10px;
  transition: background   var(--ma-duration-fast) var(--ma-ease-out),
              box-shadow   var(--ma-duration-fast) var(--ma-ease-out),
              transform    var(--ma-duration-fast) var(--ma-ease-out);
  white-space: nowrap;
  line-height: 1;
}

.ma-chat-tab:hover {
  background: var(--ma-primary-hover);
  box-shadow: -5px 0 22px rgba(200, 16, 46, 0.50),
               0  0  0   1px rgba(200, 16, 46, 0.20) inset;
}

.ma-chat-tab:focus-visible {
  outline: 2px solid var(--ma-primary);
  outline-offset: 3px;
}

.ma-chat-tab.hidden {
  display: none;
}

/* Nudge pulse */
@keyframes ma-nudge {
  0%, 100% { box-shadow: -3px 0 16px rgba(200,16,46,0.35), 0 0 0 0 rgba(200,16,46,0); }
  50%       { box-shadow: -3px 0 16px rgba(200,16,46,0.35), 0 0 0 12px rgba(200,16,46,0.28); }
}

.ma-chat-tab.nudge {
  animation: ma-nudge 1.3s ease-in-out 2;
}


/* ════════════════════════════════════════════════════════
   OVERLAY
   ════════════════════════════════════════════════════════ */
.ma-chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 25, 0.60);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity      var(--ma-duration-med) var(--ma-ease-out),
              visibility   var(--ma-duration-med);
  touch-action: none;
}

.ma-chat-overlay.open {
  opacity: 1;
  visibility: visible;
}


/* ════════════════════════════════════════════════════════
   PANEL
   ════════════════════════════════════════════════════════ */
.ma-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  height: 100dvh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: var(--ma-bg);
  border-left: 1px solid var(--ma-border);
  transform: translateX(102%);
  transition: transform 320ms var(--ma-ease-out);
  box-shadow: var(--ma-panel-shadow);
  box-sizing: border-box;
  /* Subtle top sheen — panel feels premium not flat */
  background-image: linear-gradient(
    180deg,
    rgba(255,255,255,0.04) 0px,
    rgba(255,255,255,0) 120px
  );
}

.ma-chat-panel.open {
  transform: translateX(0);
}


/* ════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════ */
.ma-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px 16px;
  background: var(--ma-dark);
  /* Thin red rule at bottom */
  border-bottom: 2px solid var(--ma-primary);
  /* Subtle top gradient sheen */
  background-image: linear-gradient(
    135deg,
    rgba(255,255,255,0.035) 0%,
    transparent 60%
  );
  flex-shrink: 0;
}

.ma-chat-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ma-chat-header-title {
  font-family: var(--ma-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ma-text-on-dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.ma-chat-header-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ma-font-mono);
  font-size: 10px;
  color: rgba(200, 16, 46, 0.80);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
}

/* Pulsing online status dot */
.ma-chat-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.50);
  animation: ma-status-pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ma-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(34,197,94,0.50); }
  50%       { box-shadow: 0 0 0 4px rgba(34,197,94,0);    }
}

.ma-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ma-chat-human-link {
  font-family: var(--ma-font-mono);
  font-size: 10.5px;
  color: rgba(200, 16, 46, 0.85);
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border: 1px solid rgba(200, 16, 46, 0.35);
  border-radius: var(--ma-radius-sm);
  transition: background     var(--ma-duration-fast),
              color           var(--ma-duration-fast),
              border-color    var(--ma-duration-fast);
  cursor: pointer;
  background: transparent;
  white-space: nowrap;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
}

.ma-chat-human-link:hover {
  background: var(--ma-primary);
  color: #fff;
  border-color: var(--ma-primary);
}

.ma-chat-close {
  background: none;
  border: none;
  color: rgba(242, 239, 234, 0.40);
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  font-size: 16px;
  border-radius: var(--ma-radius-sm);
  transition: color            var(--ma-duration-fast),
              background       var(--ma-duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ma-chat-close:hover {
  color: var(--ma-text-on-dark);
  background: rgba(255,255,255,0.07);
}


/* ════════════════════════════════════════════════════════
   MESSAGES AREA
   ════════════════════════════════════════════════════════ */
.ma-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--ma-border-strong) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  min-height: 0;
  background: var(--ma-bg);
}

.ma-chat-messages::-webkit-scrollbar       { width: 3px; }
.ma-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ma-chat-messages::-webkit-scrollbar-thumb { background: var(--ma-border-strong); border-radius: 2px; }


/* ════════════════════════════════════════════════════════
   MESSAGE BUBBLES — fade + rise entrance
   ════════════════════════════════════════════════════════ */
@keyframes ma-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

@media (prefers-reduced-motion: no-preference) {
  .ma-msg--enter {
    animation: ma-msg-in 180ms var(--ma-ease-out) both;
  }
}

.ma-msg {
  max-width: 86%;
  font-family: var(--ma-font-body);
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ma-text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 0;
}

/* ── Bot bubble ── */
.ma-msg--bot {
  align-self: flex-start;
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 3px  rgba(31,33,36,0.06),
              0 4px 12px rgba(31,33,36,0.05);
  padding: 14px 16px;
}

/* Rich text inside bot bubble */
.ma-msg--bot p {
  margin: 0 0 0.65em;
  line-height: 1.62;
}

.ma-msg--bot p:last-child {
  margin-bottom: 0;
}

.ma-msg--bot ul,
.ma-msg--bot ol {
  margin: 0.45em 0 0.65em 0;
  padding-left: 1.25em;
}

.ma-msg--bot ul {
  list-style: none;
  padding-left: 0;
}

.ma-msg--bot ul li {
  padding-left: 1.3em;
  position: relative;
  margin-bottom: 0.35em;
  line-height: 1.55;
}

.ma-msg--bot ul li:last-child {
  margin-bottom: 0;
}

/* Red custom bullet */
.ma-msg--bot ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.57em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ma-primary);
  flex-shrink: 0;
}

.ma-msg--bot ol {
  list-style: decimal;
  padding-left: 1.4em;
}

.ma-msg--bot ol li {
  margin-bottom: 0.35em;
  line-height: 1.55;
  padding-left: 0.2em;
}

.ma-msg--bot ol li::marker {
  color: var(--ma-primary);
  font-weight: 700;
  font-size: 0.85em;
}

.ma-msg--bot strong {
  font-weight: 700;
  color: var(--ma-dark);
}

.ma-msg--bot em {
  font-style: italic;
  color: inherit;
}

.ma-msg--bot a {
  color: var(--ma-primary);
  text-decoration: underline;
  text-decoration-color: rgba(200, 16, 46, 0.40);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--ma-duration-fast),
              color                  var(--ma-duration-fast);
  font-weight: 500;
}

.ma-msg--bot a:hover {
  color: var(--ma-primary-hover);
  text-decoration-color: var(--ma-primary-hover);
}

/* ── User bubble ── */
.ma-msg--user {
  align-self: flex-end;
  background: var(--ma-dark);
  color: var(--ma-text-on-dark);
  border-radius: 16px;
  border-bottom-right-radius: 5px;
  box-shadow: 0 2px 8px rgba(31,33,36,0.22),
              0 1px 3px rgba(31,33,36,0.14);
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.58;
}

/* ── System message ── */
.ma-msg--system {
  align-self: center;
  background: transparent;
  color: var(--ma-text-muted);
  font-family: var(--ma-font-mono);
  font-size: 10.5px;
  text-align: center;
  padding: 5px 8px;
  border: none;
  letter-spacing: 0.03em;
}


/* ════════════════════════════════════════════════════════
   CTA BUTTONS (inline in messages)
   ════════════════════════════════════════════════════════ */
.ma-msg-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 10px 20px;
  background: var(--ma-primary);
  color: #fff;
  border: none;
  border-radius: var(--ma-radius-md);
  font-family: var(--ma-font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.015em;
  transition: background   var(--ma-duration-fast) var(--ma-ease-out),
              transform    var(--ma-duration-fast) var(--ma-ease-out),
              box-shadow   var(--ma-duration-fast) var(--ma-ease-out);
  box-shadow: 0 2px 8px rgba(200,16,46,0.28);
}

.ma-msg-cta::after {
  content: '→';
  display: inline-block;
  transition: transform var(--ma-duration-fast) var(--ma-ease-out);
  font-family: var(--ma-font-body);
  font-weight: 400;
}

.ma-msg-cta:hover {
  background: var(--ma-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(200,16,46,0.38);
}

.ma-msg-cta:hover::after {
  transform: translateX(3px);
}

.ma-msg-cta--outline {
  background: transparent;
  border: 1.5px solid var(--ma-primary);
  color: var(--ma-primary);
  box-shadow: none;
}

.ma-msg-cta--outline:hover {
  background: var(--ma-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(200,16,46,0.28);
}


/* ════════════════════════════════════════════════════════
   SUGGESTION CHIPS
   ════════════════════════════════════════════════════════ */
.ma-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin-top: 4px;
  flex-shrink: 0;
}

.ma-chat-chip {
  background: var(--ma-surface);
  color: var(--ma-text-secondary);
  border: 1px solid var(--ma-border-strong);
  border-radius: var(--ma-radius-pill);
  padding: 8px 16px;
  font-family: var(--ma-font-display);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: border-color var(--ma-duration-fast),
              color        var(--ma-duration-fast),
              background   var(--ma-duration-fast),
              box-shadow   var(--ma-duration-fast);
  white-space: nowrap;
  line-height: 1;
}

.ma-chat-chip:hover {
  border-color: var(--ma-primary);
  color: var(--ma-primary);
  background: var(--ma-primary-muted);
  box-shadow: 0 2px 8px rgba(200,16,46,0.10);
}


/* ════════════════════════════════════════════════════════
   PRODUCT CARD — premium pre-launch
   ════════════════════════════════════════════════════════ */
.ma-product-card {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius-lg);
  overflow: hidden;
  margin-top: 12px;
  max-width: 100%;
  transition: border-color   var(--ma-duration-med) var(--ma-ease-out),
              box-shadow     var(--ma-duration-med) var(--ma-ease-out),
              transform      var(--ma-duration-med) var(--ma-ease-out);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(31,33,36,0.07),
              0 4px 12px rgba(31,33,36,0.05);
}

.ma-product-card:hover {
  border-color: rgba(200, 16, 46, 0.30);
  box-shadow: 0 4px 20px rgba(200, 16, 46, 0.10),
              0 2px 6px  rgba(31,33,36,0.08);
  transform: translateY(-2px);
}

/* Image wrapper — handles scale-on-hover cleanly */
.ma-product-card-img-wrap {
  overflow: hidden;
  border-radius: var(--ma-radius-lg) var(--ma-radius-lg) 0 0;
  background: var(--ma-surface-elevated);
  height: 158px;
}

.ma-product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 360ms var(--ma-ease-out);
}

.ma-product-card:hover .ma-product-card-img {
  transform: scale(1.04);
}

.ma-product-card-body {
  padding: 14px 16px 16px;
}

/* Pill badges row */
.ma-product-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.ma-product-card-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--ma-radius-pill);
  font-family: var(--ma-font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.ma-product-card-pill--waitlist {
  background: var(--ma-primary);
  color: #fff;
}

.ma-product-card-pill--cat {
  background: var(--ma-surface-elevated);
  color: var(--ma-text-secondary);
  border: 1px solid var(--ma-border-strong);
}

.ma-product-card-name {
  font-family: var(--ma-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ma-text);
  margin: 0 0 5px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.ma-product-card-desc {
  font-family: var(--ma-font-body);
  font-size: 13px;
  color: var(--ma-text-secondary);
  margin: 0 0 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ma-product-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.ma-product-card-price {
  font-family: var(--ma-font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ma-text);
  letter-spacing: -0.01em;
}

.ma-product-card-link {
  font-family: var(--ma-font-display);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ma-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.01em;
  transition: color         var(--ma-duration-fast),
              gap           var(--ma-duration-fast) var(--ma-ease-out);
}

.ma-product-card-link::after {
  content: '→';
  display: inline-block;
  transition: transform var(--ma-duration-fast) var(--ma-ease-out);
  font-weight: 400;
}

.ma-product-card-link:hover {
  color: var(--ma-primary-hover);
}

.ma-product-card-link:hover::after {
  transform: translateX(3px);
}


/* ════════════════════════════════════════════════════════
   TYPING INDICATOR — red wave
   ════════════════════════════════════════════════════════ */
.ma-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
  align-self: flex-start;
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 3px rgba(31,33,36,0.06);
  flex-shrink: 0;
}

.ma-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ma-primary);
  opacity: 0.45;
  animation: ma-typing-wave 1.5s infinite ease-in-out;
}

.ma-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.ma-typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes ma-typing-wave {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.45; }
  30%            { transform: translateY(-6px); opacity: 1;    }
}


/* ════════════════════════════════════════════════════════
   LEAD CAPTURE FORM
   ════════════════════════════════════════════════════════ */
.ma-lead-form {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-left: 3px solid var(--ma-primary);
  border-radius: var(--ma-radius-md);
  padding: 18px;
  margin-top: 8px;
  align-self: flex-start;
  max-width: 90%;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(31,33,36,0.06);
}

.ma-lead-form-title {
  font-family: var(--ma-font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ma-text);
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}

.ma-lead-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 11px;
}

.ma-lead-form-label {
  font-family: var(--ma-font-mono);
  font-size: 10px;
  color: var(--ma-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.ma-lead-form-input {
  background: var(--ma-bg);
  border: 1px solid var(--ma-border-strong);
  border-radius: var(--ma-radius-sm);
  padding: 10px 12px;
  font-family: var(--ma-font-body);
  font-size: 13.5px;
  color: var(--ma-text);
  outline: none;
  transition: border-color var(--ma-duration-fast),
              box-shadow   var(--ma-duration-fast);
  width: 100%;
  box-sizing: border-box;
}

textarea.ma-lead-form-input {
  resize: vertical;
  min-height: 62px;
  line-height: 1.55;
}

.ma-lead-form-input:focus {
  border-color: var(--ma-primary);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.09);
}

.ma-lead-form-input::placeholder {
  color: var(--ma-text-muted);
}

.ma-lead-form-submit {
  width: 100%;
  padding: 11px;
  background: var(--ma-primary);
  color: #fff;
  border: none;
  border-radius: var(--ma-radius-md);
  font-family: var(--ma-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition: background   var(--ma-duration-fast),
              transform    var(--ma-duration-fast),
              box-shadow   var(--ma-duration-fast);
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(200,16,46,0.24);
}

.ma-lead-form-submit:hover {
  background: var(--ma-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(200,16,46,0.32);
}

.ma-lead-form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


/* ════════════════════════════════════════════════════════
   INPUT AREA
   ════════════════════════════════════════════════════════ */
.ma-chat-input-area {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--ma-surface-warm);
  border-top: 1px solid var(--ma-border);
  flex-shrink: 0;
}

.ma-chat-input {
  flex: 1;
  background: var(--ma-surface);
  border: 1px solid var(--ma-border-strong);
  border-radius: 22px;
  padding: 10px 16px;
  font-family: var(--ma-font-body);
  font-size: 14px;
  color: var(--ma-text);
  outline: none;
  transition: border-color var(--ma-duration-fast),
              box-shadow   var(--ma-duration-fast);
  resize: none;
  line-height: 1.4;
}

.ma-chat-input:focus {
  border-color: var(--ma-primary);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.09);
}

.ma-chat-input::placeholder {
  color: var(--ma-text-muted);
  font-size: 13.5px;
}

/* Circular red send button */
.ma-chat-send {
  background: var(--ma-primary);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background   var(--ma-duration-fast) var(--ma-ease-out),
              transform    var(--ma-duration-fast) var(--ma-ease-out),
              box-shadow   var(--ma-duration-fast) var(--ma-ease-out);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(200,16,46,0.30);
}

.ma-chat-send:hover {
  background: var(--ma-primary-hover);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 14px rgba(200,16,46,0.40);
}

.ma-chat-send:disabled {
  opacity: 0.40;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ma-chat-send svg {
  width: 17px;
  height: 17px;
  fill: #fff;
  /* nudge icon slightly right for optical balance */
  transform: translateX(1px);
}


/* ════════════════════════════════════════════════════════
   ADD-TO-CART INLINE BUTTON
   ════════════════════════════════════════════════════════ */
.ma-msg-addtocart {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 9px 18px;
  background: var(--ma-dark);
  color: var(--ma-text-on-dark);
  border: 1.5px solid var(--ma-dark-mid);
  border-radius: var(--ma-radius-md);
  font-family: var(--ma-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background    var(--ma-duration-fast),
              border-color  var(--ma-duration-fast),
              box-shadow    var(--ma-duration-fast);
}

.ma-msg-addtocart:hover {
  background: #000;
  border-color: var(--ma-primary);
  box-shadow: 0 2px 8px rgba(200,16,46,0.20);
}

.ma-msg-addtocart.added {
  background: #1a3a25;
  border-color: #2a6040;
  color: #4ade80;
  cursor: default;
}


/* ════════════════════════════════════════════════════════
   POWERED BY
   ════════════════════════════════════════════════════════ */
.ma-chat-powered {
  text-align: center;
  padding: 7px;
  font-family: var(--ma-font-mono);
  font-size: 10px;
  color: var(--ma-text-muted);
  background: var(--ma-surface-warm);
  border-top: 1px solid var(--ma-border);
  flex-shrink: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */
@media (max-width: 520px) {
  .ma-chat-panel {
    width: 100%;
    max-width: 100%;
    border-left: none;
    /* Rounded top corners — bottom-sheet feel on mobile */
    border-radius: 18px 18px 0 0;
    /* Panel slides up from bottom on mobile */
    top: auto;
    bottom: 0;
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
    transform: translateY(102%);
    right: 0;
    left: 0;
    box-shadow: 0 -6px 30px rgba(31,33,36,0.18),
                0 0 0 1px rgba(31,33,36,0.06);
  }

  .ma-chat-panel.open {
    transform: translateY(0);
  }

  .ma-chat-input-area {
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .ma-chat-tab {
    top: auto;
    bottom: 20px;
    transform: rotate(-90deg) translateX(50%);
  }

  .ma-msg {
    max-width: 90%;
  }
}

@media (min-width: 521px) and (max-width: 768px) {
  .ma-chat-panel {
    width: 100%;
    max-width: 420px;
  }
}

/* ────────────────────────────────────────────────────────
   Reduced motion — kill all animations, keep transitions
   ────────────────────────────────────────────────────────*/
@media (prefers-reduced-motion: reduce) {
  .ma-chat-tab,
  .ma-chat-panel,
  .ma-chat-overlay,
  .ma-msg,
  .ma-chat-send,
  .ma-msg-cta,
  .ma-product-card,
  .ma-product-card-img {
    transition-duration: 0ms !important;
    animation: none !important;
  }

  .ma-chat-status-dot {
    animation: none;
  }

  .ma-typing-dot {
    animation: none;
    opacity: 0.5;
  }
}
