/* El Makina Digital — theme.css : thème clair/sombre + assistant. Voir em-ui.js */

/* ===== A. Mode sombre généré depuis les styles existants (gen_dark.py) ===== */
/* ---- Généré automatiquement depuis les styles existants (ne pas éditer à la main) ---- */
html[data-theme="dark"] body { background: var(--em-bg); color: var(--em-text); }
html[data-theme="dark"] nav:not([class]) { background: var(--em-surface); border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .nav-links a { color: var(--em-text); }
html[data-theme="dark"] .nav-email { color: var(--em-text-secondary); }
html[data-theme="dark"] .mobile-menu-btn { color: var(--em-text); }
html[data-theme="dark"] .sidebar-menu { background: var(--em-surface); }
html[data-theme="dark"] .close-sidebar { color: var(--em-text); }
html[data-theme="dark"] .sidebar-search input { border: 1px solid var(--em-border); }
html[data-theme="dark"] .sidebar-nav a { color: var(--em-text); }
html[data-theme="dark"] .stats-section { border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .stat-box { border-right: 1px solid var(--em-border); }
html[data-theme="dark"] .stat-num { color: var(--em-text); }
html[data-theme="dark"] .stat-label { color: var(--em-text-secondary); }
html[data-theme="dark"] .section.bg-light { background: var(--em-bg-secondary); }
html[data-theme="dark"] .section-title { color: var(--em-text); }
html[data-theme="dark"] .section-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] .services-grid { border: 1px solid var(--em-border); }
html[data-theme="dark"] .svc-card { background: var(--em-bg); }
html[data-theme="dark"] .svc-card:hover { background: var(--em-bg-secondary); }
html[data-theme="dark"] .svc-title { color: var(--em-text); }
html[data-theme="dark"] .svc-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] .value-card { background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .value-title { color: var(--em-text); }
html[data-theme="dark"] .value-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] .step-bubble { background: var(--em-surface); }
html[data-theme="dark"] .step-title { color: var(--em-text); }
html[data-theme="dark"] .step-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] .newsletter-checkbox { color: var(--em-text-secondary); }
html[data-theme="dark"] .breadcrumb-bar { color: var(--em-text-secondary); border-bottom: 1px solid var(--em-border); background: var(--em-bg-secondary); }
html[data-theme="dark"] .breadcrumb-bar a { color: var(--em-text-secondary); }
html[data-theme="dark"] .lp-intro p { color: var(--em-text-secondary); }
html[data-theme="dark"] .check-grid li { color: var(--em-text); }
html[data-theme="dark"] .value-list li { color: var(--em-text-secondary); }
html[data-theme="dark"] .faq-list details { border-bottom: 1px solid var(--em-border); background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .faq-list details p { color: var(--em-text-secondary); }
html[data-theme="dark"] .related-links a { border: 1px solid var(--em-border); color: var(--em-text); background: var(--em-bg); }
html[data-theme="dark"] .mini-stats { border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .mstat { border-right: 1px solid var(--em-border); }
html[data-theme="dark"] .mstat-num { color: var(--em-text); }
html[data-theme="dark"] .mstat-label { color: var(--em-text-secondary); }
html[data-theme="dark"] .history-card { background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .history-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] .approach-card { background: var(--em-bg-secondary); }
html[data-theme="dark"] .search-status { color: var(--em-text-secondary); }
html[data-theme="dark"] .blog-card { background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .blog-title { color: var(--em-text); }
html[data-theme="dark"] .blog-title a { color: var(--em-text); }
html[data-theme="dark"] .blog-meta { color: var(--em-text-secondary); }
html[data-theme="dark"] .blog-excerpt { color: var(--em-text-secondary); }
html[data-theme="dark"] .sidebar-widget { background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .search-form { border: 1px solid var(--em-border); }
html[data-theme="dark"] .categories-list li { border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .categories-list li a { color: var(--em-text-secondary); }
html[data-theme="dark"] .recent-post { border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .recent-title a { color: var(--em-text); }
html[data-theme="dark"] .recent-date { color: var(--em-text-secondary); }
html[data-theme="dark"] .newsletter-text { color: var(--em-text-secondary); }
html[data-theme="dark"] .newsletter-input { border: 1px solid var(--em-border); }
html[data-theme="dark"] .page-link { border: 1px solid var(--em-border); color: var(--em-text-secondary); }
html[data-theme="dark"] .service-preview-card { background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .service-title { color: var(--em-text); }
html[data-theme="dark"] .service-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] .about-section { background: var(--em-bg-secondary); }
html[data-theme="dark"] .about-stat-label { color: var(--em-text-secondary); }
html[data-theme="dark"] .pack-card { background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .pack-name { color: var(--em-text); }
html[data-theme="dark"] .pack-features li { color: var(--em-text-secondary); border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .form-group select option { color: var(--em-text) !important; background: var(--em-bg) !important; }
html[data-theme="dark"] .testimonials-section { background: var(--em-bg-secondary); }
html[data-theme="dark"] .testimonial-card { background: var(--em-surface); }
html[data-theme="dark"] .testimonial-text { color: #dcdcdc; }
html[data-theme="dark"] .testimonial-name { color: var(--em-text); }
html[data-theme="dark"] .testimonial-role { color: var(--em-text-secondary); }
html[data-theme="dark"] .section-subtitle { color: var(--em-text-secondary); }
html[data-theme="dark"] .approach-section { border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .filter-bar { border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .filter-label-txt { color: var(--em-text-secondary); }
html[data-theme="dark"] .fbtn { border: 1.5px solid var(--em-border); color: var(--em-text-secondary); }
html[data-theme="dark"] .pcard { border: 1px solid var(--em-border); background: var(--em-surface); }
html[data-theme="dark"] .pcard-title { color: var(--em-text); }
html[data-theme="dark"] .pcard-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] .ttag { background: var(--em-bg-secondary); border: 1px solid var(--em-border); }
html[data-theme="dark"] .testi-section { background: var(--em-bg-secondary); border-top: 1px solid var(--em-border); }
html[data-theme="dark"] .testi-card { background: var(--em-surface); border: 1px solid var(--em-border); }
html[data-theme="dark"] .testi-text { color: var(--em-text-secondary); }
html[data-theme="dark"] .testi-name { color: var(--em-text); }
html[data-theme="dark"] .testi-role { color: var(--em-text-secondary); }
html[data-theme="dark"] .pcard-visit-contact { border-color: var(--em-border); color: var(--em-text); }
html[data-theme="dark"] .svc-features li { color: var(--em-text-secondary); }
html[data-theme="dark"] .section-desc, html[data-theme="dark"] .section-subtitle { color: var(--em-text-secondary); }
html[data-theme="dark"] .service-desc, html[data-theme="dark"] .value-desc, html[data-theme="dark"] .svc-desc { color: var(--em-text-secondary); }
html[data-theme="dark"] nav:not([class]):not([class]) { background: rgba(23, 23, 23, .88); }
html[data-theme="dark"] .mstat:hover { background: rgba(241, 91, 51, .12); }
html[data-theme="dark"] .bg-light .faq-list details { background: var(--em-bg); }
html[data-theme="dark"] .article-nav { background: rgba(23, 23, 23, .88); border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .breadcrumbs { color: var(--em-text-secondary); }
html[data-theme="dark"] .article-meta { color: var(--em-text-secondary); }
html[data-theme="dark"] .article-lead { background: var(--em-bg-secondary); color: #dcdcdc; }
html[data-theme="dark"] .article-content p, html[data-theme="dark"] .article-content li { color: #dcdcdc; }
html[data-theme="dark"] .article-callout { background: rgba(241, 91, 51, .12); }
html[data-theme="dark"] .article-cover { background: var(--em-bg-secondary); }
html[data-theme="dark"] .article-nav-link { border: 1px solid var(--em-border); }
html[data-theme="dark"] .article-nav-link:hover { background: rgba(241, 91, 51, .12); }
html[data-theme="dark"] .article-category { background: rgba(241, 91, 51, .12); }
html[data-theme="dark"] .article-content strong { color: var(--em-text); }
@media(max-width:960px) {
html[data-theme="dark"] .stat-box { border-bottom: 1px solid var(--em-border); }
html[data-theme="dark"] .mstat { border-bottom: 1px solid var(--em-border); }
}

/* ===== B. Réglages manuels (prioritaires) ===== */
/* ============================================================
   El Makina Digital — THÈME CLAIR / SOMBRE + ASSISTANT
   Chargé sur toutes les pages, après les styles existants.
   - Le mode CLAIR est le design existant : ce fichier n'y change presque rien.
   - Le mode SOMBRE s'active avec <html data-theme="dark"> (voir em-ui.js).
   Pour tout annuler : retirer les 3 lignes ajoutées dans le <head> des pages
   (script thème, theme.css, em-ui.js).
   ============================================================ */

/* ---------- 1. Jetons de couleur ---------- */
:root {
  --em-bg: #ffffff;
  --em-bg-secondary: #f5f5f5;
  --em-surface: #ffffff;
  --em-text: #111111;
  --em-text-secondary: #555555;
  --em-border: #e8e8e8;
  --em-accent: #f15b33;
  --em-accent-hover: #d44820;
  --em-shadow-color: rgba(17, 17, 17, .08);
  color-scheme: light;
}
html[data-theme="dark"] {
  --em-bg: #171717;
  --em-bg-secondary: #1f1f1f;
  --em-surface: #262626;
  --em-text: #ffffff;
  --em-text-secondary: #b8b8b8;
  --em-border: #383838;
  --em-accent: #f15b33;
  --em-accent-hover: #ff704d;
  --em-shadow-color: rgba(0, 0, 0, .45);
  color-scheme: dark;

  /* Variables des pages qui ne servent qu'à un seul usage : on peut les redéfinir sans risque */
  --gray: #b8b8b8;          /* texte secondaire */
  --border: #383838;        /* bordures et séparateurs */
  --light-gray: #1f1f1f;    /* fonds de sections */
  --orange-dark: #ff704d;   /* survol orange */
  /* Variables de article.css */
  --muted: #b8b8b8;
  --paper: #171717;
  --soft: #1f1f1f;
  --dark: #ffffff;
  /* Ombres de design.css */
  --em-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --em-shadow-hover: 0 18px 44px rgba(0, 0, 0, .5);
}

/* ---------- 2. Transition douce, uniquement au moment du changement de thème ---------- */
html.em-theme-anim, html.em-theme-anim *, html.em-theme-anim *::before, html.em-theme-anim *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  html.em-theme-anim, html.em-theme-anim * { transition: none !important; }
}

/* ---------- 3. Bouton clair / sombre (dans l'en-tête existant) ---------- */
.em-theme-toggle {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--em-border);
  border-radius: 50%;
  background: var(--em-surface);
  color: var(--em-text);
  cursor: pointer;
  transition: border-color .25s, color .25s, background .25s, transform .2s;
}
.em-theme-toggle:hover { border-color: var(--em-accent); color: var(--em-accent); }
.em-theme-toggle:active { transform: scale(.94); }
.em-theme-toggle:focus-visible { outline: 3px solid var(--em-accent); outline-offset: 3px; }
.em-theme-toggle svg { width: 18px; height: 18px; position: absolute; transition: opacity .3s, transform .45s cubic-bezier(.2, .7, .2, 1); }
.em-theme-toggle .em-icon-sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
.em-theme-toggle .em-icon-moon { opacity: 1; transform: none; }
html[data-theme="dark"] .em-theme-toggle .em-icon-sun { opacity: 1; transform: none; color: #ffb347; }
html[data-theme="dark"] .em-theme-toggle .em-icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
@media (prefers-reduced-motion: reduce) { .em-theme-toggle svg { transition: none; } }
.nav-right { gap: 16px; }
@media (max-width: 1200px) {
  .em-theme-toggle { width: 38px; height: 38px; }
  /* Mobile/tablette : le bouton se place à droite, à côté du menu */
  nav .nav-right { margin-left: auto; margin-right: 10px; }
}
/* Articles : bouton + lien « Tous les articles » côte à côte */
.em-article-actions { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- 4. MODE SOMBRE : réglages faits à la main ---------- */

/* Logo : le texte noir devient blanc, l'orange reste orange (seul le logo est traité, jamais les photos) */
html[data-theme="dark"] .nav-logo-img,
html[data-theme="dark"] .sidebar-logo-img,
html[data-theme="dark"] .article-brand img { filter: invert(1) hue-rotate(180deg) saturate(1.4) brightness(1.05); }

/* En-tête */
html[data-theme="dark"] nav:not([class]) {
  background: rgba(23, 23, 23, .86);
  border-bottom-color: rgba(255, 255, 255, .07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 24px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .nav-links a:hover, html[data-theme="dark"] .nav-links a.active { color: var(--em-accent); }
html[data-theme="dark"] .nav-links a:hover { background: rgba(241, 91, 51, .12); }
html[data-theme="dark"] .nav-cta { background: var(--em-accent); color: #fff; }
html[data-theme="dark"] .nav-cta:hover { background: var(--em-accent-hover); }
html[data-theme="dark"] .article-nav { background: rgba(23, 23, 23, .86); border-bottom-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .article-nav-link { border-color: var(--em-border); color: var(--em-text); }
html[data-theme="dark"] .article-nav-link:hover { background: rgba(241, 91, 51, .12); color: var(--em-accent); }

/* Menu mobile */
html[data-theme="dark"] .sidebar-menu { background: var(--em-surface); box-shadow: -5px 0 30px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .sidebar-overlay { background: rgba(0, 0, 0, .65); }
html[data-theme="dark"] .sidebar-divider { background: var(--em-border); }
html[data-theme="dark"] .sidebar-nav a:hover { color: var(--em-accent); }

/* Champs de saisie hors zones déjà sombres */
html[data-theme="dark"] .sidebar-search input,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .newsletter-input,
html[data-theme="dark"] .sidebar-widget input[type="email"],
html[data-theme="dark"] .sidebar-widget input[type="text"],
html[data-theme="dark"] .sidebar-widget input[type="search"] {
  background: var(--em-bg);
  color: var(--em-text);
  border-color: var(--em-border);
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #8a8a8a; }
html[data-theme="dark"] .form-group select option { background: #262626 !important; color: #fff !important; }

/* Cartes : surface, bordure et ombre adaptées */
html[data-theme="dark"] .service-preview-card,
html[data-theme="dark"] .value-card,
html[data-theme="dark"] .pack-card,
html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .pcard,
html[data-theme="dark"] .testimonial-card,
html[data-theme="dark"] .testi-card,
html[data-theme="dark"] .sidebar-widget,
html[data-theme="dark"] .approach-card,
html[data-theme="dark"] .history-card {
  background: var(--em-surface);
  border-color: var(--em-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
html[data-theme="dark"] .service-preview-card:hover,
html[data-theme="dark"] .value-card:hover,
html[data-theme="dark"] .blog-card:hover,
html[data-theme="dark"] .pcard:hover,
html[data-theme="dark"] .pack-card:hover,
html[data-theme="dark"] .testimonial-card:hover {
  box-shadow: 0 22px 48px rgba(0, 0, 0, .5);
  border-color: rgba(241, 91, 51, .45);
}
html[data-theme="dark"] .pack-card.recommended { border-color: var(--em-accent); box-shadow: 0 22px 50px rgba(241, 91, 51, .18); }
html[data-theme="dark"] .service-icon,
html[data-theme="dark"] .value-icon,
html[data-theme="dark"] .svc-icon-wrap { background: rgba(241, 91, 51, .14); }
/* Boutons noirs des packs : passent en clair sur les cartes sombres */
html[data-theme="dark"] .btn-pack { background: #f2f2f2; color: #111; }
html[data-theme="dark"] .btn-pack:hover { background: var(--em-accent); color: #fff; }
html[data-theme="dark"] .ttag { background: #303030; color: #cfcfcf; border-color: #3d3d3d; }
html[data-theme="dark"] .testimonial-card::after { color: rgba(241, 91, 51, .18); }

/* Sections */
html[data-theme="dark"] .section, html[data-theme="dark"] section { border-color: var(--em-border); }
html[data-theme="dark"] .mini-stats { background: linear-gradient(180deg, #1b1b1b, #171717); }
html[data-theme="dark"] .mstat:hover { background: rgba(241, 91, 51, .08); }
html[data-theme="dark"] .about-section, html[data-theme="dark"] .testimonials-section { background: var(--em-bg-secondary); }
html[data-theme="dark"] .breadcrumb-bar { background: var(--em-bg-secondary); }
html[data-theme="dark"] .faq-list details[open] { border-color: rgba(241, 91, 51, .55); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .faq-list summary { color: var(--em-text); }
html[data-theme="dark"] .related-links a:hover { background: var(--em-accent); color: #fff; border-color: var(--em-accent); }
html[data-theme="dark"] .lp-intro a, html[data-theme="dark"] .faq-list a, html[data-theme="dark"] .value-desc a,
html[data-theme="dark"] .check-grid a, html[data-theme="dark"] .section-desc a { color: #ff7a55; }

/* Photos : légèrement adoucies pour ne pas éblouir (jamais inversées) */
html[data-theme="dark"] .about-right img, html[data-theme="dark"] .blog-img,
html[data-theme="dark"] .recent-img, html[data-theme="dark"] .article-cover { filter: brightness(.9); }

/* Zones déjà sombres (contact, pied de page) : on les distingue du fond */
html[data-theme="dark"] .contact-form-section { background-color: #121212; }
html[data-theme="dark"] .footer { background: #0e0e0e; }
html[data-theme="dark"] .scroll-top-btn { background: #2e2e2e; }
html[data-theme="dark"] .scroll-top-btn:hover { background: var(--em-accent); }

/* Articles du blog */
html[data-theme="dark"] .article-content p, html[data-theme="dark"] .article-content li { color: #d6d6d6; }
html[data-theme="dark"] .article-content strong, html[data-theme="dark"] .article-content h2,
html[data-theme="dark"] .article-content h3, html[data-theme="dark"] .article-header h1 { color: #fff; }
html[data-theme="dark"] .article-content a { color: #ff7a55; }
html[data-theme="dark"] .article-lead { background: var(--em-bg-secondary); color: #e6e6e6; }
html[data-theme="dark"] .article-callout { background: rgba(241, 91, 51, .1); border-color: rgba(241, 91, 51, .3); }
html[data-theme="dark"] .article-category { background: rgba(241, 91, 51, .14); }
html[data-theme="dark"] .article-footer { border-top-color: var(--em-border); }

/* Sélection de texte */
html[data-theme="dark"] ::selection { background: rgba(241, 91, 51, .4); color: #fff; }

/* ---------- 5. Assistant El Makina (prototype, voir CHATBOT.md) ---------- */
.em-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--em-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(241, 91, 51, .38);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, background .25s;
}
.em-chat-launcher:hover { background: var(--em-accent-hover); transform: translateY(-2px); box-shadow: 0 16px 34px rgba(241, 91, 51, .45); }
.em-chat-launcher:focus-visible { outline: 3px solid var(--em-text); outline-offset: 3px; }
.em-chat-launcher svg { width: 24px; height: 24px; transition: transform .3s, opacity .2s; }
.em-chat-launcher .em-chat-ico-close { position: absolute; opacity: 0; transform: rotate(-90deg); }
.em-chat-launcher[aria-expanded="true"] .em-chat-ico-open { opacity: 0; transform: rotate(90deg); }
.em-chat-launcher[aria-expanded="true"] .em-chat-ico-close { opacity: 1; transform: none; }
/* Pile de boutons flottants (bas à droite) : assistant, WhatsApp, puis « haut de page » */
.scroll-top-btn { bottom: 92px !important; }
html.em-has-chat .scroll-top-btn { bottom: 162px !important; }

/* ---------- Bouton WhatsApp ---------- */
.em-wa-float {
  position: fixed;
  right: 27px;
  bottom: 24px;
  z-index: 899;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 211, 102, .38);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, opacity .2s, visibility .2s;
}
html.em-has-chat .em-wa-float { bottom: 96px; }
.em-wa-float:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 30px rgba(37, 211, 102, .48); color: #fff; }
.em-wa-float:focus-visible { outline: 3px solid var(--em-text); outline-offset: 3px; }
.em-wa-float svg { width: 27px; height: 27px; }
html.em-chat-open .em-wa-float { opacity: 0; visibility: hidden; transform: scale(.85); }

.em-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 901;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 130px);
  overflow: hidden;
  border: 1px solid var(--em-border);
  border-radius: 18px;
  background: var(--em-surface);
  color: var(--em-text);
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 24px 60px var(--em-shadow-color), 0 4px 14px rgba(0, 0, 0, .06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .25s, transform .3s cubic-bezier(.2, .7, .2, 1), visibility .25s;
}
.em-chat-panel.em-open { opacity: 1; visibility: visible; transform: none; }
.em-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--em-border);
}
.em-chat-avatar {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: rgba(241, 91, 51, .12);
  color: var(--em-accent);
}
.em-chat-avatar svg { width: 20px; height: 20px; }
.em-chat-title { flex: 1; min-width: 0; }
.em-chat-title strong { display: block; font-size: .95rem; line-height: 1.2; }
.em-chat-title span { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: .74rem; color: var(--em-text-secondary); }
.em-chat-title span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9a9a9a; }
.em-chat-panel[data-mode="live"] .em-chat-title span::before { background: #2fbf71; }
.em-chat-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: var(--em-text-secondary);
  cursor: pointer;
}
.em-chat-close:hover { background: var(--em-bg-secondary); color: var(--em-text); }
.em-chat-close:focus-visible { outline: 2px solid var(--em-accent); outline-offset: 1px; }
.em-chat-close svg { width: 18px; height: 18px; }

.em-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--em-bg);
  overscroll-behavior: contain;
}
.em-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.em-msg-bot { align-self: flex-start; background: var(--em-surface); border: 1px solid var(--em-border); border-bottom-left-radius: 5px; }
.em-msg-user { align-self: flex-end; background: var(--em-accent); color: #fff; border-bottom-right-radius: 5px; }
.em-msg-note {
  align-self: stretch;
  max-width: none;
  padding: 10px 12px;
  border: 1px dashed rgba(241, 91, 51, .45);
  border-radius: 12px;
  background: rgba(241, 91, 51, .06);
  color: var(--em-text-secondary);
  font-size: .8rem;
}
.em-chat-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.em-chat-quick a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--em-border);
  border-radius: 50px;
  background: var(--em-surface);
  color: var(--em-text);
  font-size: .8rem; font-weight: 700;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.em-chat-quick a:hover { border-color: var(--em-accent); color: var(--em-accent); }
/* Boutons de sujets de l'assistant guidé */
.em-chat-quick button {
  display: inline-flex; align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(241, 91, 51, .35);
  border-radius: 50px;
  background: rgba(241, 91, 51, .06);
  color: var(--em-text);
  font: inherit; font-size: .8rem; font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.em-chat-quick button:hover { border-color: var(--em-accent); background: var(--em-accent); color: #fff; }
.em-chat-quick button:focus-visible, .em-chat-quick a:focus-visible { outline: 2px solid var(--em-accent); outline-offset: 2px; }
.em-chat-quick .em-chip-menu { border-color: var(--em-border); background: transparent; color: var(--em-text-secondary); font-weight: 600; }
.em-chat-quick .em-chip-menu:hover { border-color: var(--em-text-secondary); background: var(--em-bg-secondary); color: var(--em-text); }
.em-msg-bot { white-space: pre-line; }
.em-typing { display: inline-flex; gap: 4px; align-items: center; padding: 14px; }
.em-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--em-text-secondary); animation: em-typing 1.2s infinite ease-in-out; }
.em-typing i:nth-child(2) { animation-delay: .15s; }
.em-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes em-typing { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.em-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--em-border);
  background: var(--em-surface);
}
.em-chat-input {
  flex: 1;
  min-height: 42px;
  max-height: 110px;
  padding: 11px 14px;
  border: 1px solid var(--em-border);
  border-radius: 21px;
  background: var(--em-bg);
  color: var(--em-text);
  font: inherit;
  font-size: .9rem;
  line-height: 1.35;
  resize: none;
  outline: none;
}
.em-chat-input:focus { border-color: var(--em-accent); }
.em-chat-send {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0;
  border: none; border-radius: 50%;
  background: var(--em-accent); color: #fff;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.em-chat-send:hover { background: var(--em-accent-hover); }
.em-chat-send:disabled { opacity: .45; cursor: not-allowed; }
.em-chat-send:focus-visible { outline: 3px solid var(--em-text); outline-offset: 2px; }
.em-chat-send svg { width: 18px; height: 18px; }
.em-chat-foot { padding: 0 12px 10px; background: var(--em-surface); font-size: .68rem; color: var(--em-text-secondary); text-align: center; }

@media (max-width: 600px) {
  .em-chat-launcher { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .scroll-top-btn { bottom: 76px !important; }
  html.em-has-chat .scroll-top-btn { bottom: 140px !important; }
  .em-wa-float { right: 19px; bottom: 16px; width: 46px; height: 46px; }
  html.em-has-chat .em-wa-float { bottom: 80px; }
  .em-wa-float svg { width: 25px; height: 25px; }
  .em-chat-panel { right: 8px; left: 8px; bottom: 78px; width: auto; max-width: none; height: min(72vh, 560px); border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .em-chat-panel, .em-chat-launcher, .em-chat-launcher svg, .em-wa-float { transition: none; }
  .em-typing i { animation: none; opacity: .6; }
}
@media print { .em-chat-launcher, .em-chat-panel, .em-theme-toggle, .em-wa-float { display: none !important; } }

