/* ============================================================
   FEUILLE DE STYLE PRINCIPALE — Charte "Artisan Craft & Tech"
   Référence des couleurs, arrondis et composants : DESIGN.md
   (racine du projet).

   Cette feuille est chargée APRÈS le CSS Bootstrap (CDN) : à
   spécificité égale, les règles définies ici écrasent celles de
   Bootstrap. Les boutons sont surchargés via les variables CSS
   natives de Bootstrap (--bs-btn-*), ce qui laisse Bootstrap
   gérer nativement les états hover, focus, active et disabled.
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Couleurs de marque (DESIGN.md — section Colors) */
  --lime: #8db600; /* CTA principal, succès, validation */
  --lime-hover: #8ea604;
  --lime-active: #7a9c00;
  --lime-rgb: 141, 182, 0;
  --ink: #1e2528; /* Texte principal, texte sur fond lime */
  --anthracite: #2c3539; /* Action secondaire, fonds sombres, icônes */
  --ai-accent: #95c11e; /* Accents "généré par IA" */
  --danger: #dc2626;
  --warning: #d97706;
  --muted: #6c757d; /* Texte secondaire */

  /* Surfaces */
  --surface: #f8f9fa; /* Fond de page */
  --surface-container: #e8eff3; /* Panneaux clairs (transcription…) */
  --surface-container-high: #e2e9ed; /* Chips, badges neutres */
  --hairline: #e5e7eb; /* Bordures fines : cartes, en-têtes */
  --input-border: #d1d5db; /* Bordures des champs */

  /* Arrondis (DESIGN.md — section Shapes) */
  --radius-default: 0.5rem; /* 8px — boutons, champs, petits blocs */
  --radius-md: 0.75rem; /* 12px — miniatures, logo */
  --radius-lg: 1rem; /* 16px — cartes, modals */

  /* Alias historiques — encore utilisés dans les templates (style inline) */
  --outline: var(--muted);
  --primary-container: var(--anthracite);
  --secondary-container: var(--lime);
  --text-on-surface: var(--ink);

  /* Arrondi global Bootstrap : champs et boutons à 8px (DESIGN.md) */
  --bs-border-radius: 0.5rem;
  /* Variantes compactes (form-select-sm, form-control-sm, btn-sm) :
     même rayon que les boutons standards pour éviter tout écart visuel */
  --bs-border-radius-sm: 0.5rem;

  /* Feedback "succès" aligné sur la charte : lime au lieu du vert Bootstrap */
  --bs-success: var(--lime);
  --bs-success-rgb: var(--lime-rgb);
  --bs-success-text-emphasis: var(--ink);
  --bs-success-bg-subtle: rgba(var(--lime-rgb), 0.15);
  --bs-success-border-subtle: rgba(var(--lime-rgb), 0.3);
}

/* ============================================================
   2. BOUTONS (DESIGN.md — section Components > Buttons)
   ============================================================ */

.btn {
  border-radius: var(--radius-default);
  font-weight: 700;
}

/* Action principale (CTA) : fond lime, texte anthracite.
   Hover : #8EA604 — Active : plus sombre (DESIGN.md). */
.btn-primary {
  --bs-btn-bg: var(--lime);
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--lime);
  --bs-btn-hover-bg: var(--lime-hover);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: var(--lime-hover);
  --bs-btn-active-bg: var(--lime-active);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-border-color: var(--lime-active);
  --bs-btn-focus-shadow-rgb: var(--lime-rgb);
  --bs-btn-disabled-bg: var(--lime);
  --bs-btn-disabled-color: var(--ink);
  --bs-btn-disabled-border-color: var(--lime);
}

/* Action secondaire : fond anthracite, texte blanc */
.btn-secondary {
  --bs-btn-bg: var(--anthracite);
  --bs-btn-color: #ffffff;
  --bs-btn-border-color: var(--anthracite);
  --bs-btn-hover-bg: #3b464c;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-border-color: #3b464c;
  --bs-btn-active-bg: #232b2f;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-border-color: #232b2f;
  --bs-btn-focus-shadow-rgb: 44, 53, 57;
  --bs-btn-disabled-bg: var(--anthracite);
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-border-color: var(--anthracite);
}

/* Action tertiaire : contour anthracite, fond transparent,
   rempli au survol */
.btn-outline-secondary {
  --bs-btn-color: var(--anthracite);
  --bs-btn-border-color: var(--anthracite);
  --bs-btn-hover-bg: var(--anthracite);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-border-color: var(--anthracite);
  --bs-btn-active-bg: var(--anthracite);
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-border-color: var(--anthracite);
  --bs-btn-focus-shadow-rgb: 44, 53, 57;
}

/* Action destructive */
.btn-danger {
  --bs-btn-bg: var(--danger);
  --bs-btn-color: #ffffff;
  --bs-btn-border-color: var(--danger);
  --bs-btn-hover-bg: #b21c1c;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-border-color: #b21c1c;
  --bs-btn-active-bg: #991b1b;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-border-color: #991b1b;
  --bs-btn-focus-shadow-rgb: 220, 38, 38;
  --bs-btn-disabled-bg: var(--danger);
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-border-color: var(--danger);
}

.btn-outline-danger {
  --bs-btn-color: var(--danger);
  --bs-btn-border-color: var(--danger);
  --bs-btn-hover-bg: var(--danger);
  --bs-btn-hover-border-color: var(--danger);
  --bs-btn-active-bg: #b21c1c;
  --bs-btn-active-border-color: #b21c1c;
  --bs-btn-focus-shadow-rgb: 220, 38, 38;
}

/* Bouton fantôme neutre : surface claire, bordure fine.
   Réservé aux actions tertiaires discrètes (Annuler, Retour,
   Ajouter des photos). S'emploie toujours avec .btn :
   <button class="btn btn-ghost">…</button> */
.btn-ghost {
  --bs-btn-font-weight: 600;
  --bs-btn-color: var(--anthracite);
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--hairline);
  --bs-btn-hover-color: var(--anthracite);
  --bs-btn-hover-bg: var(--surface-container);
  --bs-btn-hover-border-color: var(--hairline);
  --bs-btn-active-bg: var(--surface-container-high);
  --bs-btn-active-border-color: var(--surface-container-high);
  --bs-btn-focus-shadow-rgb: 44, 53, 57;
  --bs-btn-disabled-color: var(--muted);
  --bs-btn-disabled-bg: var(--surface-container);
  --bs-btn-disabled-border-color: var(--hairline);
}

/* Badge de confiance : texte anthracite sur fond lime pour un
   contraste correct en extérieur (DESIGN.md). */
.text-bg-success {
  color: var(--ink) !important;
}

/* ============================================================
   3. STRUCTURE
   ============================================================ */

body {
  font-family: "Inter", sans-serif;
  background-color: var(--surface);
  color: var(--text-on-surface);
  margin-bottom: 70px; /* réserve la hauteur de la nav basse */
}

/* Écrans d'authentification : pas de nav basse */
.auth-body {
  margin-bottom: 0;
}

.app-header {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.logo-box {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Le logo est bicolore sur fond transparent : jamais de fond derrière lui,
   et object-fit: contain pour ne jamais le rogner */
.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Version agrandie (écrans d'authentification) */
.logo-box-lg {
  width: 256px;
  height: 256px;
}

.logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: -0.02em;
}

/* Nav basse mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--anthracite);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1030;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
}

.nav-item i {
  font-size: 20px;
  margin-bottom: 2px;
}

.nav-item.active {
  color: var(--lime);
}

/* Menu déroulant (roue crantée de l'en-tête) :
   survol teinté lime et sélection lime au lieu du bleu Bootstrap */
.dropdown-menu {
  --bs-dropdown-link-hover-bg: rgba(var(--lime-rgb), 0.15);
  --bs-dropdown-link-hover-color: var(--anthracite);
  --bs-dropdown-link-active-bg: var(--lime);
  --bs-dropdown-link-active-color: var(--ink);
}

.page-head {
  padding: 20px 0;
}

/* ============================================================
   4. CARTES & LISTES
   ============================================================ */

/* Carte standard : blanc, bordure fine, ombre légère (DESIGN.md Layer 1) */
.card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 3px rgba(30, 37, 40, 0.05),
    0 1px 2px rgba(30, 37, 40, 0.03);
}

.card-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
}

/* Zone de saisie longue (description de chantier) */
.textarea-card {
  background: #ffffff;
  border: 1px solid var(--hairline);
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 3px rgba(30, 37, 40, 0.05),
    0 1px 2px rgba(30, 37, 40, 0.03);
}

/* Carte chantier / estimation (pages de listes).
   color explicite : la classe est aussi utilisée sur des <a>,
   sinon Bootstrap peindrait le texte en bleu. */
.chantier-card {
  color: var(--text-on-surface);
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 16px;
}

.chantier-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--anthracite);
  border: solid 1px transparent;
}

.chantier-thumb-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--surface-container-high);
  color: var(--anthracite);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.chantier-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.chantier-meta i {
  margin-right: 4px;
}

/* Coordonnées cliquables (tel / mailto) */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-container-high);
  color: var(--anthracite);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  text-decoration: none;
}

.contact-link:hover {
  color: var(--anthracite);
  background: var(--surface-container);
}

.card-footer-row {
  border-top: 1px solid rgba(30, 37, 40, 0.07);
  margin-top: 12px;
  padding-top: 10px;
}

/* Pièces jointes (onglet Fichiers d'un projet) */
.annexe-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(30, 37, 40, 0.07);
  text-decoration: none;
  color: var(--text-on-surface);
}

.annexe-row:last-child {
  border: none;
  padding-bottom: 0;
}

.annexe-row:first-of-type {
  padding-top: 4px;
}

/* ============================================================
   5. FILTRES & TAGS DE STATUT
   ============================================================ */

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 6px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

/* Chip de filtre : aussi utilisée comme onglet dans la page projet */
.filter-chip {
  background: var(--surface-container-high);
  color: var(--text-on-surface);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  border: none;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--anthracite);
  color: var(--lime);
}

.count-badge {
  background: var(--surface-container-high);
  color: var(--text-on-surface);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 50px;
}

/* Tag de statut chantier (lime = validé / actif, DESIGN.md) */
.status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Tags de statut chantier — progression du cycle de vie
   (foncé = action à faire, neutre = attente, lime = gagné/actif) */
.tag-a-envoyer {
  background: var(--anthracite);
  color: #ffffff;
}

.tag-envoye {
  background: var(--surface-container-high);
  color: var(--text-on-surface);
}

.tag-accepte {
  background: var(--lime);
  color: var(--ink);
}

.tag-encours {
  background: rgba(var(--lime-rgb), 0.15);
  color: var(--ink);
}

.tag-termine {
  background: var(--surface-container);
  color: var(--muted);
}

/* ============================================================
   6. ÉTATS VIDES (composant _empty_state.html.twig)
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 48px 16px;
}

/* Pastille icône : style "badge IA" du DESIGN.md
   (fond teinté lime, bordure lime, icône anthracite) */
.empty-state-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: rgba(var(--lime-rgb), 0.15);
  border: 1px solid var(--lime);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--anthracite);
}

.empty-state-title {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--muted);
  max-width: 280px;
  margin: 0 auto 20px;
}

/* ============================================================
   7. PAGE PROJET
   ============================================================ */

/* Barre d'onglets sticky : les chips tiennent sur une seule ligne
   et défilent horizontalement (même comportement que .filter-bar) */
.tab-bar {
  position: sticky;
  top: 61px; /* hauteur du app-header */
  z-index: 1010;
  background: var(--surface);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--hairline);
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

/* Panneaux d'onglets (affichage géré en JS) */
.tab-pane-custom {
  display: none;
}

.tab-pane-custom.show {
  display: block;
}

/* ============================================================
   8. ESTIMATION (carte sombre)
   ============================================================ */

.estimate-card {
  background: var(--anthracite);
  color: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.estimate-header {
  background: var(--lime);
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  padding: 6px 16px;
  letter-spacing: 0.05em;
}

.estimate-body {
  padding: 20px 16px;
}

.total-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--lime);
  margin: 0;
}

/* Lignes de devis */
.line-item {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.line-item:last-child {
  border: none;
  margin-bottom: 0;
}

/* Champs à l'intérieur de la carte sombre */
.estimate-body input,
.estimate-body select,
.estimate-body textarea {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 14px;
  border-radius: var(--radius-default);
}

.estimate-body input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.estimate-body input:focus,
.estimate-body select:focus,
.estimate-body textarea:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: var(--lime);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(var(--lime-rgb), 0.25);
}

.estimate-body .form-select option {
  background-color: var(--anthracite);
  color: #ffffff;
}

/* Bloc de transcription vocale */
.transcript-box {
  background: var(--surface-container);
  padding: 12px;
  border-radius: var(--radius-default);
  margin-top: 8px;
}

/* Carrousels de photos */
.carousel,
.carousel-inner {
  border-radius: var(--radius-md);
}

.carousel .carousel-control-prev-icon,
.carousel .carousel-control-next-icon {
  border-radius: var(--radius-default);
  background-color: var(--anthracite);
}

.carousel .carousel-indicators button {
  border-radius: var(--radius-default);
  background-color: #ffffff;
}

#visualizationCarousel img {
  height: 400px;
  object-fit: cover;
  object-position: center;
}

/* ============================================================
   9. PHOTOS (page demande d'estimation)
   ============================================================ */

/* Carte photos : même gabarit que .textarea-card (DESIGN.md) */
.photo-card {
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow:
    0 1px 3px rgba(30, 37, 40, 0.05),
    0 1px 2px rgba(30, 37, 40, 0.03);
}

/* Bande de miniatures : alignée à gauche, défilement horizontal */
.photo-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.photo-preview-container {
  position: relative;
}

/* Miniature carrée */
.photos-square {
  flex: 0 0 auto;
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-container);
  border: 1px solid var(--hairline);
}

/* Bouton de suppression de photo : pastille ronde */
.photo-preview-container .btn-danger {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

.photo-preview-container .btn-danger i {
  font-size: 14px;
}

#photos-preview::-webkit-scrollbar {
  height: 2px;
}

#photos-preview::-webkit-scrollbar-track {
  background: var(--surface);
}

#photos-preview::-webkit-scrollbar-thumb {
  background: var(--lime);
}

/* Carré d'ajout : pointillés lime discrets sur surface claire.
   Purement visuel : l'ajout de photos passe par les boutons sous la bande. */
.photos-empty-square {
  flex: 0 0 auto;
  width: 140px;
  height: 140px;
  border: 2px dashed rgba(var(--lime-rgb), 0.45);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.photos-empty-icon {
  font-size: 22px;
  color: var(--lime);
}

/* ============================================================
   10. FORMULAIRES
   ============================================================ */

.form-control,
.form-select {
  border-color: var(--input-border);
  font-size: 14px;
}

/* Focus charte : bordure lime + halo discret (DESIGN.md) */
.form-control:focus,
.form-select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(var(--lime-rgb), 0.15);
}

.form-floating > label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* Case à cocher : lime au lieu du bleu Bootstrap */
.form-check-input {
  border-color: var(--input-border);
}

/* NOTE : ne pas toucher aux marges Bootstrap des .form-check :
   .form-check { padding-left: 1.5em } et .form-check .form-check-input { margin-left: -1.5em }
   se compensent mutuellement : la case s'aligne naturellement à gauche avec les autres champs.
   Une override partielle (sans le sélecteur double .form-check .form-check-input) casse l'alignement. */

.form-check-input:checked {
  background-color: var(--lime);
  border-color: var(--lime);
}

.form-check-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(var(--lime-rgb), 0.15);
}

/* Texte tronqué à 2 lignes (descriptifs de chantier) */
.desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Lien charte : anthracite, lime au survol */
.link-chart {
  color: var(--anthracite);
  font-weight: 700;
  text-decoration: none;
}

.link-chart:hover {
  color: var(--lime);
}

/* ============================================================
   11. MODALS, LOADER, ANIMATIONS & UTILITAIRES
   ============================================================ */

.modal-content {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(30, 37, 40, 0.12); /* Layer 2 DESIGN.md */
}

.modal-header {
  border-bottom: 0;
  padding-bottom: 0;
}

.modal-header .modal-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header .modal-title i {
  color: var(--anthracite);
}

.modal-footer {
  border-top: 0;
}

/* Apparition douce des contenus */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-in {
  animation: fadeIn 0.4s ease-out;
}

/* Retour tactile : l'élément s'enfonce légèrement à l'appui */
.active-depress:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Utilitaires maison complétant Bootstrap */
.fw-800 {
  font-weight: 800;
}

.fs-10 {
  font-size: 10px;
}

.fs-11 {
  font-size: 11px;
}

.letter-spacing-sm {
  letter-spacing: 0.05em;
}

/* Grille de photos (tab Photos du chantier) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--anthracite);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ===== Messagerie du chantier (page suivi client + onglet artisan) ===== */
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-row {
  display: flex;
}

/* Les messages de l'artisan sont alignés à droite */
.message-row.from-artisan {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background-color: #ffffff;
  border: 1px solid var(--hairline);
}

/* Bulle de l'artisan : fond lime léger */
.message-row.from-artisan .message-bubble {
  background-color: rgba(var(--lime-rgb), 0.15);
  border-color: rgba(var(--lime-rgb), 0.3);
}

.message-meta {
  font-size: 11px;
  color: var(--muted);
}

.message-content {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Pièce jointe document dans une bulle */
.message-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-default);
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: bold;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 4px;
}

.message-attachment:last-child {
  margin-bottom: 0;
}

/* Aperçu d'un document (non image) dans la prévisualisation avant envoi */
.message-preview-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 8px;
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  text-align: center;
}

.message-preview-file i {
  font-size: 22px;
}

.message-preview-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ============================================
   Dictée vocale - bouton micro en écoute
   ============================================ */
@keyframes mic-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.mic-pulse {
  animation: mic-pulse 1.2s ease-in-out infinite;
}
