/**
 * ████████████████████████████████████████████████████████████████
 * MAHAYAWEN PORTAL v2.0 — CSS Cinématographique
 * Interface IA du futur · Cosmos · Waveforms · Glassmorphism
 * ████████████████████████████████████████████████████████████████
 */

/* ── Animations globales ─────────────────────────────────────── */
@keyframes mhp-bloom {
  0%   { opacity:0; transform:scale(0.82) translateY(24px); filter:blur(12px); }
  60%  { filter:blur(0); }
  100% { opacity:1; transform:scale(1) translateY(0); filter:blur(0); }
}
@keyframes mhp-fade-in {
  from { opacity:0; } to { opacity:1; }
}
@keyframes mhp-pulse-ring {
  0%   { transform:scale(1);   opacity:0.35; }
  70%  { transform:scale(1.25); opacity:0; }
  100% { transform:scale(1.25); opacity:0; }
}
@keyframes mhp-spin-slow {
  to { transform:rotate(360deg); }
}
@keyframes mhp-avatar-ring {
  0%,100% { opacity:0.5; transform:scale(1);   }
  50%      { opacity:1;   transform:scale(1.08); }
}
@keyframes mhp-typing-dot {
  0%,80%,100% { transform:translateY(0);   opacity:0.3; }
  40%          { transform:translateY(-6px);opacity:1;   }
}
@keyframes mhp-msg-in {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0);    }
}
@keyframes mhp-scan-line {
  0%   { left:-100%; }
  100% { left:120%;  }
}
@keyframes mhp-trigger-idle {
  0%,100% { box-shadow: 0 0 0 0   color-mix(in srgb, var(--accent,#8b5cf6) 35%, transparent),
                        0 6px 24px color-mix(in srgb, var(--accent,#8b5cf6) 25%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent,#8b5cf6) 10%, transparent),
                        0 6px 24px color-mix(in srgb, var(--accent,#8b5cf6) 30%, transparent); }
}
@keyframes mhp-trigger-listen {
  0%,100% { box-shadow:0 0 0 0   rgba(52,211,153,0.5), 0 6px 20px rgba(52,211,153,0.3); }
  50%      { box-shadow:0 0 0 6px rgba(52,211,153,0),   0 6px 20px rgba(52,211,153,0.35); }
}
@keyframes mhp-trigger-speaking {
  0%,100% { box-shadow:0 0 0 0   rgba(139,92,246,0.6), 0 6px 20px rgba(139,92,246,0.3); }
  50%      { box-shadow:0 0 0 8px rgba(139,92,246,0),   0 6px 20px rgba(139,92,246,0.4); }
}
@keyframes mhp-chip-glow {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}
@keyframes mhp-status-blink {
  0%,100% { opacity:1; } 50% { opacity:0.3; }
}

/* ── Trigger wrapper — ancre de position ─────────────────────── */
#mhp-trigger-wrap {
  position: fixed;
  bottom: max(24px, calc(16px + env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 0;
  transition: opacity 0.2s ease,
              transform 0.45s cubic-bezier(0.34,1.56,0.64,1),
              bottom 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
#mhp-trigger-wrap:hover {
  opacity: 1;
}

/* État masqué — glisse sous le bas de l'écran, seul 6px restent visibles */
#mhp-trigger-wrap.mhp-hidden {
  bottom: calc(-62px + max(24px, calc(16px + env(safe-area-inset-bottom))));
}
/* Au hover sur le wrap caché → remonte entièrement */
#mhp-trigger-wrap.mhp-hidden:hover {
  bottom: max(24px, calc(16px + env(safe-area-inset-bottom)));
}

/* Petit onglet "peek" visible en état masqué */
#mhp-trigger-peek {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 6px;
  border-radius: 3px 3px 0 0;
  background: color-mix(in srgb, var(--accent,#8b5cf6) 55%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  margin-bottom: -1px;
}
#mhp-trigger-wrap.mhp-hidden #mhp-trigger-peek {
  opacity: 1;
  pointer-events: auto;
}

/* Bouton ✕ — apparaît au hover sur le wrap (état visible) */
#mhp-trigger-hide {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(10,10,22,0.82);
  color: rgba(255,255,255,0.55);
  font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  z-index: 2;
  pointer-events: none;
}
#mhp-trigger-wrap:hover #mhp-trigger-hide:not(.mhp-hidden-el) {
  opacity: 1;
  pointer-events: auto;
}
#mhp-trigger-hide:hover { color: #fff; }

/* ── Trigger button — orbe circulaire élégante ───────────────── */
#mhp-trigger {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;

  background: radial-gradient(circle at 35% 30%,
    rgba(255,255,255,0.10) 0%,
    rgba(20,10,40,0.90) 70%
  );
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent,#8b5cf6) 35%, rgba(255,255,255,0.10)),
    0 6px 20px rgba(0,0,0,0.40),
    0 0 0 0 color-mix(in srgb, var(--accent,#8b5cf6) 30%, transparent);

  animation: mhp-trigger-idle 3s ease-in-out infinite;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
}
#mhp-trigger:hover  { transform: scale(1.1); }
#mhp-trigger:active { transform: scale(0.93); }
#mhp-trigger[data-state="listening"] { animation: mhp-trigger-listen   1.4s ease-in-out infinite; }
#mhp-trigger[data-state="speaking"]  { animation: mhp-trigger-speaking  1.6s ease-in-out infinite; }
#mhp-trigger[data-state="processing"]{ animation: mhp-trigger-speaking  0.9s ease-in-out infinite; }

/* Rings autour du bouton trigger */
.mhp-t-ring1, .mhp-t-ring2 {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent,#8b5cf6) 20%, transparent);
  animation: mhp-pulse-ring 3.2s ease-out infinite;
  pointer-events: none;
}
.mhp-t-ring2 { inset:-7px; animation-delay:1.4s; opacity:0.3; }
.mhp-t-ring1[data-state="listening"], .mhp-t-ring2[data-state="listening"] {
  border-color: rgba(52,211,153,0.35);
}
.mhp-t-ring1[data-state="speaking"],  .mhp-t-ring2[data-state="speaking"] {
  border-color: rgba(139,92,246,0.4);
}

/* Core du bouton — contient l'image */
.mhp-t-core {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mhp-t-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 50%; }
.mhp-t-fallback {
  font-size: 1.6rem; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
/* Label caché — plus besoin de texte, l'orbe parle d'elle-même */
.mhp-t-label { display: none; }

/* ── Portal overlay ──────────────────────────────────────────── */
#mhp-portal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#mhp-portal.mhp-open { display: flex; }

#mhp-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 12, 0.88);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  animation: mhp-fade-in 0.32s ease;
}

/* ── Portal window ────────────────────────────────────────────── */
.mhp-window {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: min(820px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;

  background:
    radial-gradient(ellipse at 20% 0%,   color-mix(in srgb, var(--accent,#8b5cf6) 10%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, color-mix(in srgb, #6366f1 8%, transparent) 0%, transparent 50%),
    linear-gradient(160deg, rgba(12,12,28,0.98) 0%, rgba(6,6,16,0.99) 100%);
  border: 1px solid color-mix(in srgb, var(--accent,#8b5cf6) 22%, rgba(255,255,255,0.06));
  border-radius: 28px;
  overflow: hidden;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 40px 120px rgba(0,0,0,0.7),
    0 0 80px color-mix(in srgb, var(--accent,#8b5cf6) 12%, transparent);

  opacity: 0;
  transform: scale(0.88) translateY(30px);
  transition: opacity 0.38s cubic-bezier(0.22,1,0.36,1),
              transform 0.38s cubic-bezier(0.22,1,0.36,1);
}
.mhp-window.mhp-win-open {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Particles canvas */
.mhp-particles {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.6;
}

/* ── Header ───────────────────────────────────────────────────── */
.mhp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  gap: 12px;
}
.mhp-header-left { display:flex; align-items:center; gap:14px; }
.mhp-header-right { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }

/* Avatar */
.mhp-avatar-wrap {
  position: relative;
  width: 52px; height: 52px;
  flex-shrink: 0;
}
.mhp-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent,#8b5cf6) 40%, transparent);
  filter: brightness(1.15) contrast(1.05);
}
.mhp-avatar-fallback {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent,#8b5cf6), #6366f1);
  color: #fff; font-size: 1.4rem;
  align-items: center; justify-content: center;
}
.mhp-avatar-ring {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent,#8b5cf6) 45%, transparent);
  animation: mhp-avatar-ring 2.5s ease-in-out infinite;
  pointer-events: none;
}

.mhp-header-name {
  font-size: 1.1rem; font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}
.mhp-header-status {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 2px;
  background: none !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}
.mhp-status-dot {
  display: inline-block !important;
  width: 6px !important; height: 6px !important;
  min-width: 6px !important; max-width: 6px !important;
  min-height: 6px !important; max-height: 6px !important;
  border-radius: 50% !important;
  background: #22c55e !important;
  animation: mhp-status-blink 3s ease-in-out infinite;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(34,197,94,0.4);
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
#mhp-status-text {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.03em;
  font-weight: 500;
}

/* Voice profiles pills */
.mhp-vpills {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.mhp-vpill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: transform 0.18s ease-out, background 0.18s ease-out, border-color 0.18s ease-out, color 0.18s ease-out, opacity 0.18s ease-out;
}
.mhp-vpill:hover { border-color:rgba(255,255,255,0.25); color:rgba(255,255,255,0.7); }
.mhp-vpill.active {
  background: color-mix(in srgb, var(--accent,#8b5cf6) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent,#8b5cf6) 55%, transparent);
  color: #fff;
}

/* Header buttons */
.mhp-hbtn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: transform 0.18s ease-out, background 0.18s ease-out, border-color 0.18s ease-out, color 0.18s ease-out, opacity 0.18s ease-out;
  flex-shrink: 0;
}
.mhp-hbtn:hover { background:rgba(255,255,255,0.1); color:#fff; border-color:rgba(255,255,255,0.2); }
.mhp-close-btn:hover { background:rgba(239,68,68,0.2); color:#ef4444; border-color:rgba(239,68,68,0.3); }

/* ── Messages ─────────────────────────────────────────────────── */
.mhp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative; z-index: 2;
  scroll-behavior: smooth;
}
.mhp-messages::-webkit-scrollbar { width: 4px; }
.mhp-messages::-webkit-scrollbar-track { background: transparent; }
.mhp-messages::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 2px; }

.mhp-msg { display:flex; gap:10px; animation: mhp-msg-in 0.22s ease; }
.mhp-msg--bot  { align-items:flex-start; }
.mhp-msg--user { flex-direction:row-reverse; align-items:flex-start; }

/* Bot avatar chip */
.mhp-bot-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent,#8b5cf6) 0%, #6366f1 100%);
  color: #fff; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid color-mix(in srgb, var(--accent,#8b5cf6) 50%, transparent);
}

.mhp-bubble {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.55;
  font-size: 0.875rem;
  word-break: break-word;
}
.mhp-bubble--bot {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.88);
  border-top-left-radius: 4px;
}
.mhp-bubble--bot strong { color: #fff; font-weight: 700; }
.mhp-bubble--bot code {
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 4px; padding: 1px 5px;
  font-family: monospace; font-size: 0.82rem;
  color: #a78bfa;
}
.mhp-bubble--user {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent,#8b5cf6) 85%, #000) 0%,
    color-mix(in srgb, #6366f1 80%, #000) 100%
  );
  color: #fff;
  border-top-right-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--accent,#8b5cf6) 40%, transparent);
}

.mhp-time {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.22);
  margin-top: 4px;
  display: block;
  padding: 0 4px;
}
.mhp-msg--user .mhp-time { text-align: right; }

/* Typing indicator */
.mhp-typing-bubble {
  display: flex; align-items: center; gap: 5px;
  padding: 14px 18px;
}
.mhp-typing-bubble span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent,#8b5cf6) 70%, #fff);
  display: inline-block;
  animation: mhp-typing-dot 1.2s ease-in-out infinite;
}
.mhp-typing-bubble span:nth-child(2) { animation-delay: 0.18s; }
.mhp-typing-bubble span:nth-child(3) { animation-delay: 0.36s; }

/* ── Waveform zone ────────────────────────────────────────────── */
.mhp-wave-indicator {
  position: relative; z-index: 2;
  padding: 8px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: opacity 0.3s;
}
.mhp-wave-canvas {
  width: 100%; height: 64px;
  max-width: 520px;
  display: block;
}
.mhp-wave-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  height: 14px;
  transition: color 0.3s;
}
.mhp-wave-indicator[data-mode="listening"] .mhp-wave-label { color: rgba(52,211,153,0.6); }
.mhp-wave-indicator[data-mode="speaking"]  .mhp-wave-label { color: color-mix(in srgb, var(--accent,#8b5cf6) 70%, #fff); }
.mhp-wave-indicator[data-mode="processing"] .mhp-wave-label { color: rgba(251,191,36,0.6); }

/* ── Quick action chips v2 — Premium icon cards ──────────────── */
.mhp-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 24px 10px;
  position: relative; z-index: 2;
  flex-shrink: 0;
}
.mhp-qchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 8px;
  border-radius: 12px;
  font-size: 0.72rem; font-weight: 600;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.mhp-qc-ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.mhp-qchip:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
  transform: translateY(-1px);
}
.mhp-qchip:active { transform: scale(0.96); }

/* Per-category colors */
.mhp-qc-tasks .mhp-qc-ico   { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.15); }
.mhp-qc-tasks:hover .mhp-qc-ico { background: rgba(52,211,153,0.22); box-shadow: 0 0 10px rgba(52,211,153,0.2); }
.mhp-qc-agenda .mhp-qc-ico   { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.15); }
.mhp-qc-agenda:hover .mhp-qc-ico { background: rgba(59,130,246,0.22); box-shadow: 0 0 10px rgba(59,130,246,0.2); }
.mhp-qc-rapport .mhp-qc-ico  { background: rgba(251,146,60,0.12); color: #fb923c; border: 1px solid rgba(251,146,60,0.15); }
.mhp-qc-rapport:hover .mhp-qc-ico { background: rgba(251,146,60,0.22); box-shadow: 0 0 10px rgba(251,146,60,0.2); }
.mhp-qc-note .mhp-qc-ico     { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.15); }
.mhp-qc-note:hover .mhp-qc-ico { background: rgba(251,191,36,0.22); box-shadow: 0 0 10px rgba(251,191,36,0.2); }
.mhp-qc-email .mhp-qc-ico    { background: rgba(99,102,241,0.12); color: #818cf8; border: 1px solid rgba(99,102,241,0.15); }
.mhp-qc-email:hover .mhp-qc-ico { background: rgba(99,102,241,0.22); box-shadow: 0 0 10px rgba(99,102,241,0.2); }
.mhp-qc-factures .mhp-qc-ico { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.15); }
.mhp-qc-factures:hover .mhp-qc-ico { background: rgba(16,185,129,0.22); box-shadow: 0 0 10px rgba(16,185,129,0.2); }
.mhp-qc-idee .mhp-qc-ico     { background: rgba(244,114,182,0.12); color: #f472b6; border: 1px solid rgba(244,114,182,0.15); }
.mhp-qc-idee:hover .mhp-qc-ico { background: rgba(244,114,182,0.22); box-shadow: 0 0 10px rgba(244,114,182,0.2); }
.mhp-qc-academy .mhp-qc-ico  { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.15); }
.mhp-qc-academy:hover .mhp-qc-ico { background: rgba(139,92,246,0.22); box-shadow: 0 0 10px rgba(139,92,246,0.2); }

/* TTS button active state */
.mhp-hbtn.mhp-tts-active {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.35);
  color: #a78bfa;
}

/* ── Input zone ───────────────────────────────────────────────── */
.mhp-input-zone {
  position: relative; z-index: 2;
  padding: 0 20px 20px;
  flex-shrink: 0;
}

/* Transcript bar (vocal interim results) */
.mhp-transcript {
  display: none;
  position: relative;
  overflow: hidden;
  padding: 8px 16px;
  margin-bottom: 8px;
  background: rgba(52,211,153,0.06);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: 10px;
  color: rgba(52,211,153,0.85);
  font-size: 0.8rem;
}
.mhp-transcript.visible { display: block; }
.mhp-transcript-scan {
  position: absolute; top:0; bottom:0; width: 40px;
  background: linear-gradient(90deg, transparent, rgba(52,211,153,0.3), transparent);
  animation: mhp-scan-line 1.5s linear infinite;
}

/* Input bar */
.mhp-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 10px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mhp-input-bar:focus-within {
  border-color: color-mix(in srgb, var(--accent,#8b5cf6) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent,#8b5cf6) 10%, transparent);
}

.mhp-input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.875rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  padding: 2px 0;
  font-family: inherit;
}
.mhp-input::placeholder { color: rgba(255,255,255,0.25); }
.mhp-input::-webkit-scrollbar { width: 3px; }
.mhp-input::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Voice button */
.mhp-voice-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.mhp-voice-btn:hover { background:rgba(52,211,153,0.12); border-color:rgba(52,211,153,0.4); color:rgba(52,211,153,0.9); }
.mhp-voice-btn.listening {
  background: rgba(52,211,153,0.15);
  border-color: rgba(52,211,153,0.6);
  color: #34d399;
  box-shadow: 0 0 16px rgba(52,211,153,0.25);
  animation: mhp-trigger-listen 1.2s ease-in-out infinite;
}

/* Send button */
.mhp-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg,
    var(--accent,#8b5cf6) 0%,
    color-mix(in srgb, var(--accent,#8b5cf6) 70%, #6366f1) 100%
  );
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent,#8b5cf6) 35%, transparent);
}
.mhp-send-btn:hover { transform: scale(1.1); box-shadow:0 6px 20px color-mix(in srgb, var(--accent,#8b5cf6) 50%, transparent); }
.mhp-send-btn:active { transform: scale(0.92); }

/* ── Mobile responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
  #mhp-trigger-wrap {
    bottom: max(18px, calc(68px + env(safe-area-inset-bottom)));
  }
  #mhp-trigger-wrap.mhp-hidden {
    bottom: calc(-62px + max(18px, calc(68px + env(safe-area-inset-bottom))));
  }
  #mhp-trigger-wrap.mhp-hidden:hover {
    bottom: max(18px, calc(68px + env(safe-area-inset-bottom)));
  }
  #mhp-trigger { width: 44px; height: 44px; }
  .mhp-t-logo  { width: 34px; height: 34px; }

  #mhp-portal { padding: 0; align-items: flex-end; }
  .mhp-window {
    border-radius: 24px 24px 0 0;
    max-height: 92vh;
    width: 100%;
    box-shadow: 0 -20px 60px rgba(0,0,0,0.6), 0 0 40px color-mix(in srgb, var(--accent,#8b5cf6) 10%, transparent);
  }
  .mhp-header { padding: 16px 18px 12px; }
  .mhp-vpills { display: none; }
  .mhp-messages { padding: 16px 18px 8px; }
  .mhp-bubble { max-width: 85%; font-size: 0.84rem; }
  .mhp-quick-row { padding: 6px 18px 8px; gap: 5px; }
  .mhp-qchip { font-size: 0.7rem; padding: 5px 10px; }
  .mhp-input-zone { padding: 0 14px 16px; }
  .mhp-wave-canvas { height: 48px; }
}

/* ── Masquer le bouton quand pas connecté ─────────────────────── */
body:not(.logged-in) #mhp-trigger-wrap { display: none !important; }

/* ── Disable old triggers/panels (replaced by portal) ────────── */
#mdp-trigger-btn  { display: none !important; }
#maha-orb         { display: none !important; }
#maha-mobile-fab  { display: none !important; }
#chatbot-toggle   { display: none !important; }
#chatbot-window   { display: none !important; }

/* ── Pomodoro : masquer la pastille flottante (accessible via outils) */
.pomodoro-widget.collapsed { display: none !important; }
#pomodoro-fab             { display: none !important; }


/* ── Galaxy View: masquer le portail Mahayawen (la boule dorée du bas) ── */
body.galaxy-active #mhp-trigger-wrap,
body.galaxy-active #mhp-portal,
body.galaxy-active #mhp-overlay {
    display: none !important;
    pointer-events: none !important;
}

/* Témoignage quick chip */
.mhp-qc-temoignage .mhp-qc-ico   { background: rgba(244,63,94,0.12); color: #f43f5e; border: 1px solid rgba(244,63,94,0.15); }
.mhp-qc-temoignage:hover .mhp-qc-ico { background: rgba(244,63,94,0.22); box-shadow: 0 0 10px rgba(244,63,94,0.2); }

/* Testimony action button above input */
.mhp-testimony-action {
  display: flex;
  justify-content: center;
  padding: 6px 12px 2px;
}
.mhp-testimony-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, rgba(244,63,94,0.15), rgba(251,113,133,0.1));
  border: 1px solid rgba(244,63,94,0.25);
  color: #fb7185;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  text-transform: uppercase;
}
.mhp-testimony-button:hover {
  background: linear-gradient(135deg, rgba(244,63,94,0.28), rgba(251,113,133,0.18));
  border-color: rgba(244,63,94,0.45);
  box-shadow: 0 0 16px rgba(244,63,94,0.2), 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
  color: #f43f5e;
}
.mhp-testimony-button:active {
  transform: scale(0.97);
}
.mhp-testimony-button svg {
  flex-shrink: 0;
}

/* ── Testimony mode background ───────────────────────────────── */
#mhp-overlay.mhp-testimony-active {
  background: url('/images/testimony-bg.jpg') center center / cover no-repeat !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: background 0.4s ease;
}
#mhp-overlay.mhp-testimony-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 12, 0.35);
  pointer-events: none;
}
