/* ═══════════════════════════════════════════════════════════
   DUNE CHAT WIDGET — BAR EDITION
   All classes prefixed with .dune- to avoid conflicts
   ═══════════════════════════════════════════════════════════ */

/* ── Dune Bar (full-width, between nav and hero) ────────── */
.dune-bar {
  width: 100%;
  background: linear-gradient(135deg, #2C6B9E 0%, #3A82BD 45%, #2C6B9E 100%);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  border-top: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 24px rgba(44, 107, 158, 0.35);
}

.dune-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 21px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dune-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.dune-bar-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(212, 170, 92, 0.15);
  border: 2px solid rgba(212, 170, 92, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #D4AA5C;
}

.dune-bar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dune-bar-avatar svg {
  width: 33px;
  height: 33px;
}

.dune-bar-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dune-bar-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: #F5F0E8;
  line-height: 1.2;
}

.dune-bar-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: rgba(212, 170, 92, 0.7);
  letter-spacing: 0.02em;
}

.dune-bar-center {
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.dune-bar-cta {
  font-family: 'DM Sans', sans-serif;
  font-size: 21px;
  color: rgba(245, 240, 232, 0.6);
  letter-spacing: 0.01em;
}

/* ── Split-flap rotating text ──────────────────────────────── */
.dune-flap-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}
.dune-flap-label {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(11px, 1.1vw, 15px);
  font-weight: 400;
  color: rgba(245,240,232,0.45);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.dune-flap-text {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1.6vw, 19px);
  font-weight: 700;
  color: #F5F0E8;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  display: block;
  flex: 1;
  min-width: 0;
  transition: opacity 0.32s ease, transform 0.32s ease;
  letter-spacing: 0.01em;
  border-bottom: 1.5px solid rgba(212,170,92,0.35);
  padding-bottom: 1px;
}
.dune-flap-text:hover {
  color: #FFD980;
  border-bottom-color: #D4AA5C;
  transform: scale(1.025);
  text-shadow: 0 0 12px rgba(212,170,92,0.35);
}

/* Micro-guidance hint */
.dune-flap-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.3);
  margin-top: 2px;
  user-select: none;
  pointer-events: none;
  width: 100%;
  text-align: center;
  padding-left: 80px; /* shift right to align under rotating phrase, past the label */
}
@media (max-width: 768px) {
  .dune-flap-hint { display: none; }
}
.dune-flap-char {
  display: inline-block;
  transform-origin: center center;
  will-change: transform;
  white-space: pre; /* preserve space characters exactly */
  backface-visibility: hidden;
}
.dune-flap-char:not(.dune-flap-settled) {
  color: rgba(212,170,92,0.85);
}

/* ── Quick reply buttons ──────────────────────────────────────────── */
.dune-reply-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 10px;
  align-self: flex-end;
  animation: dune-modal-in 0.3s ease-out;
}
.dune-reply-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  background: rgba(212,170,92,0.08);
  border: 1px solid rgba(212,170,92,0.4);
  border-radius: 999px;
  color: #1A1412;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.dune-reply-btn:hover {
  background: #D4AA5C;
  border-color: #D4AA5C;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(212,170,92,0.25);
}

.dune-bar-right {
  flex-shrink: 0;
}

.dune-bar-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.dune-bar-open-btn {
  background: #D4AA5C;
  color: #1A1412;
}

.dune-bar-open-btn:hover {
  background: #C49A4C;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 170, 92, 0.3);
}

.dune-bar-active .dune-bar-open-btn {
  background: rgba(212, 170, 92, 0.2);
  color: #D4AA5C;
}

/* Mobile bar — 2-row layout */
@media (max-width: 768px) {
  .dune-bar-inner {
    padding: 12px 16px 10px;
    gap: 6px 12px;
    flex-wrap: wrap; /* enables 2nd row */
    align-items: center;
  }

  /* Row 1: avatar + name + button */
  .dune-bar-left {
    order: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .dune-bar-right {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Row 2: full-width rotating text */
  .dune-bar-center {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0 2px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 2px;
  }

  .dune-bar-avatar { width: 38px; height: 38px; }
  .dune-bar-avatar svg { width: 21px; height: 21px; }
  .dune-bar-info { display: flex; } /* show name on row 1 */
  .dune-bar-name { font-size: 15px; }
  .dune-bar-subtitle { font-size: 11px; }

  .dune-flap-wrap { gap: 8px; width: 100%; justify-content: center; }
  .dune-flap-label {
    display: inline; /* show label on row 2 */
    font-size: clamp(10px, 2.5vw, 13px);
  }
  .dune-flap-text {
    font-size: clamp(13px, 3.5vw, 17px);
    max-width: none;
    flex: 1;
  }
  .dune-flap-hint { font-size: 9px; margin-top: 2px; }
  .dune-bar-btn { padding: 9px 16px; font-size: 13px; white-space: nowrap; }
}

/* ── Chat Panel ──────────────────────────────────────────── */
.dune-panel {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  background: #F5F0E8;
  position: relative;
  z-index: 98;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  /* Ensure it stays in normal document flow below the bar */
  float: none;
  clear: both;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(26, 20, 18, 0.1);
}

.dune-panel.dune-open {
  max-height: 780px;
  border-bottom: 2px solid rgba(212, 170, 92, 0.3);
}

@media (max-width: 768px) {
  .dune-panel.dune-open {
    max-height: 80vh;
  }
}

/* ── Header ──────────────────────────────────────────────── */
.dune-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #F5F0E8;
  border-bottom: 1px solid #E8E0D4;
  flex-shrink: 0;
}

.dune-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(212, 170, 92, 0.12);
  border: 2px solid #D4AA5C;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #D4AA5C;
  flex-shrink: 0;
}

.dune-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dune-header-avatar svg {
  width: 18px;
  height: 18px;
}

.dune-header-info {
  flex: 1;
  min-width: 0;
}

.dune-header-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: #1A1412;
  line-height: 1.2;
}

.dune-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dune-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5CB85C;
}

.dune-status-dot.dune-listening {
  background: #D4AA5C;
  animation: dune-pulse 1s infinite;
}

.dune-status-dot.dune-speaking {
  background: #D4AA5C;
  animation: dune-pulse 0.6s infinite;
}

.dune-status-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #8B7355;
}

.dune-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dune-header-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  color: #8B7355;
  transition: all 0.15s;
}

.dune-header-btn:hover {
  background: rgba(212, 170, 92, 0.1);
  color: #1A1412;
}

.dune-header-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Welcome Screen ──────────────────────────────────────── */
.dune-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  overflow-y: auto;
}

.dune-welcome-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(212, 170, 92, 0.12);
  border: 2px solid #D4AA5C;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #D4AA5C;
  margin-bottom: 12px;
}

.dune-welcome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dune-welcome-avatar svg {
  width: 28px;
  height: 28px;
}

.dune-welcome-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: #1A1412;
  margin-bottom: 4px;
}

.dune-welcome-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #8B7355;
  margin-bottom: 24px;
}

/* Quick action buttons */
.dune-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 400px;
}

.dune-quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid #E8E0D4;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1A1412;
  text-align: left;
  transition: all 0.2s;
}

.dune-quick-btn:hover {
  border-color: #D4AA5C;
  box-shadow: 0 2px 8px rgba(212, 170, 92, 0.15);
  transform: translateY(-1px);
}

.dune-quick-btn svg {
  width: 18px;
  height: 18px;
  color: #D4AA5C;
  flex-shrink: 0;
}

/* ── Messages ────────────────────────────────────────────── */
.dune-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 400px;
}

.dune-msg-row {
  display: flex;
  gap: 8px;
  max-width: 85%;
}

.dune-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.dune-msg-ai {
  align-self: flex-start;
}

.dune-msg-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(212, 170, 92, 0.12);
  border: 1px solid rgba(212, 170, 92, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #D4AA5C;
  flex-shrink: 0;
  margin-top: 2px;
}

.dune-msg-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dune-msg-avatar-sm svg {
  width: 12px;
  height: 12px;
}

.dune-msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dune-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.dune-msg-user .dune-msg-bubble {
  background: #D4AA5C;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.dune-msg-ai .dune-msg-bubble {
  background: #FFFFFF;
  color: #1A1412;
  border: 1px solid #E8E0D4;
  border-bottom-left-radius: 4px;
}

.dune-msg-bubble p { margin: 0 0 8px; }
.dune-msg-bubble p:last-child { margin-bottom: 0; }
.dune-msg-bubble ul { margin: 4px 0; padding-left: 18px; }
.dune-msg-bubble li { margin-bottom: 4px; }
.dune-msg-bubble strong { font-weight: 600; }

/* Speak button */
.dune-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: #8B7355;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 0;
}

.dune-speak-btn:hover { opacity: 1; color: #D4AA5C; }
.dune-speak-btn svg { width: 14px; height: 14px; }

/* First-message speak hint */
.dune-speak-btn::after {
  content: 'Tap to hear';
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  background: #1A1412;
  color: #F5F0E8;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.dune-speak-btn.dune-speak-hint::after {
  opacity: 1;
  animation: dune-hint-fade 3s forwards;
}

@keyframes dune-hint-fade {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

/* Typing indicator */
.dune-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.dune-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D4AA5C;
  animation: dune-bounce 1.2s ease-in-out infinite;
}

.dune-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.dune-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dune-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

@keyframes dune-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Input Area ──────────────────────────────────────────── */
.dune-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E8E0D4;
  flex-shrink: 0;
}

.dune-input-wrapper {
  flex: 1;
  position: relative;
}

.dune-input {
  width: 100%;
  padding: 10px 16px;
  background: #F5F0E8;
  border: 1px solid #E8E0D4;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #1A1412;
  outline: none;
  transition: border-color 0.2s;
}

.dune-input::placeholder { color: #8B7355; opacity: 0.6; }
.dune-input:focus { border-color: #D4AA5C; }

.dune-input-listening {
  display: none;
  position: absolute;
  inset: 0;
  background: #F5F0E8;
  border: 1px solid #D4AA5C;
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #8B7355;
}

.dune-input-listening.dune-active { display: flex; }

.dune-listening-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E74C3C;
  animation: dune-pulse 0.8s infinite;
  flex-shrink: 0;
}

.dune-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.dune-wave-bar {
  width: 3px;
  height: 12px;
  background: #D4AA5C;
  border-radius: 2px;
  animation: dune-wave 0.8s ease-in-out infinite;
}

.dune-wave-bar:nth-child(2) { animation-delay: 0.1s; height: 18px; }
.dune-wave-bar:nth-child(3) { animation-delay: 0.2s; height: 24px; }
.dune-wave-bar:nth-child(4) { animation-delay: 0.3s; height: 16px; }
.dune-wave-bar:nth-child(5) { animation-delay: 0.4s; height: 10px; }

@keyframes dune-wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* Mic button */
.dune-mic-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E8E0D4;
  background: #FFFFFF;
  border-radius: 50%;
  cursor: pointer;
  color: #8B7355;
  transition: all 0.2s;
  flex-shrink: 0;
}

.dune-mic-btn:hover { border-color: #D4AA5C; color: #D4AA5C; }
.dune-mic-btn.dune-active { background: #D4AA5C; color: #FFFFFF; border-color: #D4AA5C; }
.dune-mic-btn svg { width: 18px; height: 18px; }

/* Send button */
.dune-send-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #E8E0D4;
  border-radius: 50%;
  cursor: pointer;
  color: #8B7355;
  transition: all 0.2s;
  flex-shrink: 0;
}

.dune-send-btn.dune-active { background: #D4AA5C; color: #FFFFFF; }
.dune-send-btn:hover { background: #D4AA5C; color: #FFFFFF; }
.dune-send-btn svg { width: 18px; height: 18px; }

/* ── Overlay & Modal ─────────────────────────────────────── */
.dune-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 18, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.dune-overlay.dune-visible { display: flex; }

.dune-modal {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(26, 20, 18, 0.2);
  animation: dune-modal-in 0.3s ease-out;
}

@keyframes dune-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dune-modal-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(212, 170, 92, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4AA5C;
}

.dune-modal-icon svg { width: 20px; height: 20px; }

.dune-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: #1A1412;
  margin-bottom: 8px;
}

.dune-modal-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #8B7355;
  margin-bottom: 24px;
}

.dune-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.dune-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.dune-btn-ghost {
  background: none;
  border: 1px solid #E8E0D4;
  color: #8B7355;
}

.dune-btn-ghost:hover { border-color: #D4AA5C; color: #1A1412; }

.dune-btn-primary {
  background: #D4AA5C;
  border: 1px solid #D4AA5C;
  color: #FFFFFF;
}

.dune-btn-primary:hover { background: #C49A4C; }

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Avatar Hover Animation ──────────────────────────────── */
.dune-avatar-el {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dune-avatar-el img,
.dune-avatar-el video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dune-avatar-video {
  display: none;
  position: absolute;
  inset: 0;
}

/* Scale up on hover — all avatar containers */
.dune-bar-avatar,
.dune-header-avatar,
.dune-welcome-avatar {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  cursor: pointer;
}

.dune-bar-avatar:hover,
.dune-header-avatar:hover,
.dune-welcome-avatar:hover {
  transform: scale(4);
  box-shadow: 0 12px 40px rgba(212, 170, 92, 0.4);
  z-index: 1000;
  position: relative;
}

/* Small avatars in messages — scale less aggressively */
.dune-msg-avatar-sm {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.dune-msg-avatar-sm:hover {
  transform: scale(1.5);
  z-index: 10;
  position: relative;
}

/* ── Mobile: lock scroll when chat is open ───────────────── */
body.dune-chat-open {
  overflow: hidden;
  /* Prevent page from jumping when scrollbar disappears */
  padding-right: 0 !important;
}

@media (max-width: 768px) {
  /* On mobile, bar + panel stick below the site nav when chat is open */
  .dune-bar.dune-bar-active {
    position: sticky;
    /* top is set dynamically by JS to nav height */
    z-index: 200;
  }

  .dune-panel.dune-open {
    position: sticky;
    top: 74px; /* fallback: mobile bar height ~74px */
    max-height: calc(100dvh - 74px);
    z-index: 199;
    overflow-y: auto;
  }
}

/* ── Example Prompts ─────────────────────────────────────── */
.dune-example-prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #E8E0D4;
  width: 100%;
  max-width: 400px;
  justify-content: center;
}

.dune-example-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8B7355;
  width: 100%;
  text-align: center;
  margin-bottom: 2px;
}

.dune-example-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #D4AA5C;
  background: rgba(212, 170, 92, 0.08);
  border: 1px solid rgba(212, 170, 92, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-style: italic;
}

.dune-example-btn:hover {
  background: rgba(212, 170, 92, 0.15);
  border-color: #D4AA5C;
  transform: translateY(-1px);
}

/* ── Modal Animated Avatar ───────────────────────────────── */
.dune-modal-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 16px;
  position: relative;
  border: 2px solid rgba(212, 170, 92, 0.4);
  background: rgba(212, 170, 92, 0.08);
  overflow: hidden;
}

.dune-modal-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.dune-modal-avatar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block; /* always visible in modal — no hover needed */
}

/* ── Continuous header animation when chat is open ───────── */
.dune-panel.dune-open .dune-header-avatar .dune-avatar-static {
  display: none;
}
.dune-panel.dune-open .dune-header-avatar .dune-avatar-video {
  display: block !important;
}
/* Also animate bar avatar while chat is open */
.dune-bar.dune-bar-active .dune-bar-avatar .dune-avatar-static {
  display: none;
}
.dune-bar.dune-bar-active .dune-bar-avatar .dune-avatar-video {
  display: block !important;
}

/* ── Desktop: fixed overlay panel (75vh) ─────────────────── */
@media (min-width: 769px) {
  .dune-bar.dune-bar-active {
    position: fixed !important;
    /* top set dynamically by JS to nav height — no hardcoded top:0 */
    left: 0;
    right: 0;
    z-index: 1001;
  }

  .dune-panel.dune-open {
    position: fixed !important;
    /* top/height set dynamically by JS */
    left: 0;
    right: 0;
    z-index: 1000;
    overflow-y: auto;
    border-bottom: 2px solid rgba(212, 170, 92, 0.3);
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  }

  /* Messages area fills available height on desktop */
  .dune-panel.dune-open .dune-messages {
    max-height: calc(75vh - 220px);
  }

  /* Overlay to dim the page behind the panel */
  body.dune-chat-open::after {
    content: '';
    display: block;
    position: fixed;
    top: 75vh;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.25);
    z-index: 998;
    pointer-events: none;
  }
}
