/**
 * Page annonces.php — écran Annonces
 */

/* Colonne : header fixe (base.css) → réserver l’espace → zone scroll → pied fixe */
#annonces-screen.annonces-has-bottom-bar {
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  /* Même logique que feuille-temps : le header ne prend pas la place dans le flux */
  padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
}

/* iOS : marge un peu plus large pour que le premier bloc ne colle jamais sous le header */
.app-ios #annonces-screen.annonces-has-bottom-bar {
  padding-top: calc(env(safe-area-inset-top, 0px) + 88px);
}

#annonces-screen.annonces-has-bottom-bar .formulaire-main.annonces-main {
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-top: 8px;
  /* 64px : aligné sur device-adaptive (barre onglets jusqu’à 64px) — évite que le fixe z-index 1000
   * capte les taps sur le bas du contenu (assistant popup / bannière). */
  padding-bottom: calc(64px + max(12px, env(safe-area-inset-bottom, 0px)));
  box-sizing: border-box;
}

/* Assistant popup : en-tête + pied fixes — seul le bloc d’étape défile */
#annonces-screen.annonces-wizard-popup-active.annonces-has-bottom-bar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#annonces-screen.annonces-wizard-popup-active.annonces-has-bottom-bar .formulaire-main.annonces-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#annonces-screen.annonces-wizard-popup-active #annonces-panel-popup-wizard {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#annonces-screen.annonces-wizard-popup-active #annonces-panel-popup-wizard .annonces-popup-wiz-step:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}
/* Comme feuille-temps : si un display flex parent gagne sur [hidden], plusieurs étapes peuvent rester visibles.
   « Qui voit ce popup ? » ne doit apparaître qu’à l’étape 4, pas avec le contenu (3) ni le moment (5). */
#annonces-screen.annonces-wizard-popup-active #annonces-panel-popup-wizard .annonces-popup-wiz-step[hidden] {
  display: none !important;
}

/* Onglet Historique : même disposition que #note-screen (note.css : .note-content, bandeau, .note-list-container). */
#annonces-screen.annonces--historique-tab.annonces-has-bottom-bar {
  padding: 0 !important;
  padding-top: clamp(48px, 12vw, 66px) !important;
  padding-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}
#annonces-screen.annonces--historique-tab.annonces-has-bottom-bar .formulaire-main.annonces-main {
  width: 100%;
  max-width: none;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
  padding: 0;
  /* Même réserve basse que le reste d’Annonces (barre onglets + safe area) — un peu plus que Notes (56px) */
  padding-bottom: calc(64px + max(12px, env(safe-area-inset-bottom, 0px)));
}
#annonces-screen.annonces--historique-tab #annonces-panel-historique {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}
/* Bandeau + champ = note.css (#note-screen et #annonces-screen #annonces-panel-historique) — chargé après annonces.css */
#annonces-screen.annonces--historique-tab.annonces-has-bottom-bar #annonces-feedback:not([hidden]) {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

/*
 * Aucun bloc d’introduction sous l’en-tête global : pas de second « titre de page »
 * dans la zone scroll (contexte : header + pied d’onglets). Barres « Autre format » masquées
 * (Annuler / Retour dans le header). Titres conservés pour aria / lecteurs d’écran.
 */
#annonces-screen .annonces-popup-wiz-topbar,
#annonces-screen .annonces-panel-ecrire .annonces-format-bar {
  display: none !important;
}

#annonces-screen #annonces-popup-wiz-sr-progress,
#annonces-screen .annonces-notif-admin-hint,
#annonces-screen .annonces-panel-popup-wizard > #annonces-popup-wiz-title,
#annonces-screen .annonces-panel-popup-wizard > #annonces-popup-wiz-subtitle,
#annonces-screen .annonces-panel-banner-wizard > #annonces-banner-wiz-title,
#annonces-screen .annonces-panel-ecrire > .conformite-section-title,
#annonces-screen .annonces-panel-ecrire > .conformite-section-desc {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}
/* L’onglet Historique n’est plus masqué ici : titre + texte d’aide visibles. */

/* Header : Retour + titre + Historique en tête + actions assistant / × liste */
#annonces-screen .annonces-header.formulaire-header {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#annonces-screen .annonces-header-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  column-gap: 6px;
  width: 100%;
  min-height: 48px;
}

#annonces-screen .annonces-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  justify-self: start;
}

#annonces-screen .annonces-header-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 6px 4px 6px 2px;
}

#annonces-screen .annonces-header-back-arrow {
  font-size: 1.15rem;
  line-height: 1;
}

#annonces-screen .annonces-header-back-text {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Historique : bouton en-tête (accessible dès l’écran choix, quand le pied « Écrire » seul est masqué) */
#annonces-screen .annonces-header-tab-historique {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  max-width: 5.5rem;
  padding: 4px 6px 3px;
  margin: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
#annonces-screen .annonces-header-tab-historique .note-nav-icon {
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
#annonces-screen .annonces-header-tab-historique .note-nav-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
  color: inherit;
  stroke: currentColor;
}
#annonces-screen .annonces-header-tab-historique .note-nav-label {
  display: block;
  width: 100%;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}
#annonces-screen .annonces-header-tab-historique:active {
  background: rgba(0, 0, 0, 0.04);
}
#annonces-screen .annonces-header-tab-historique.active {
  color: #2563eb;
  font-weight: 700;
}
@media (hover: hover) {
  #annonces-screen .annonces-header-tab-historique:hover {
    background: rgba(0, 0, 0, 0.03);
  }
}
#app-container.app-theme-night #annonces-screen .annonces-header-tab-historique {
  color: #94a3b8;
}
#app-container.app-theme-night #annonces-screen .annonces-header-tab-historique.active {
  color: #60a5fa;
}

/* Historique : gros × rouge, sans cadre ni fond (onglet Historique) — vide la liste locale */
#annonces-screen .annonces-header-hist-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  box-shadow: none;
  transition: color 0.12s ease, opacity 0.12s ease;
}
#annonces-screen .annonces-header-hist-icon-btn:hover {
  color: #b91c1c;
}
#annonces-screen .annonces-header-hist-icon-btn:active {
  opacity: 0.72;
}
#annonces-screen .annonces-header-hist-clear-x {
  display: block;
  font-size: 2.1rem;
  line-height: 0.85;
  font-weight: 200;
  letter-spacing: 0.02em;
  margin: 0;
  font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
}
#app-container.app-theme-night #annonces-screen .annonces-header-hist-icon-btn {
  background: transparent;
  border: none;
  color: #f87171;
  box-shadow: none;
}
#app-container.app-theme-night #annonces-screen .annonces-header-hist-icon-btn:hover {
  color: #fca5a5;
}
#app-container.app-theme-night #annonces-screen .annonces-header-hist-icon-btn:active {
  opacity: 0.75;
  background: transparent;
}

/* Si [hidden] est posé en JS, notre `display: inline-flex` ne doit pas le neutraliser. */
#annonces-screen .annonces-header-hist-icon-btn[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

/* Choix (cartes) et assistants : pas de × « tout supprimer » (réservé à l’onglet Historique). */
#annonces-screen.annonces-on-step-choix #annonces-header-historique-clear,
#annonces-screen.annonces-wizard-popup-active #annonces-header-historique-clear,
#annonces-screen:has(#annonces-panel-banner-wizard.active:not([hidden])) #annonces-header-historique-clear {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

/* Onglet Historique : le × (vider toute la liste) doit rester cliquable et visible. */
#annonces-screen.annonces--historique-tab #annonces-header-historique-clear:not([hidden]) {
  display: inline-flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Liste historique : accordéon par annonce (nom + × retrait + chevron dans l’en-tête de ligne). */
#annonces-screen .annonces-hist-details {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
#annonces-screen .annonces-hist-details .annonces-hist-summary {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
  list-style: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
#annonces-screen .annonces-hist-details .annonces-hist-summary::-webkit-details-marker,
#annonces-screen .annonces-hist-details .annonces-hist-summary::marker {
  display: none;
  content: '';
}
#annonces-screen .annonces-hist-details .annonces-hist-chevron {
  flex-shrink: 0;
  align-self: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  color: #b8860b;
  line-height: 1;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
#annonces-screen .annonces-hist-details[open] .annonces-hist-chevron {
  transform: rotate(90deg);
}
#annonces-screen .annonces-hist-details .annonces-hist-chevron::before {
  content: '▶';
  display: block;
  opacity: 0.85;
}
#annonces-screen .annonces-hist-panel {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0 0 0.25rem;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  margin-top: 0.5rem;
}
#annonces-screen .annonces-hist-image-wrap {
  margin: 0.55rem 0 0;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.55);
}
#annonces-screen .annonces-hist-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  vertical-align: middle;
}
#annonces-screen .annonces-hist-image-fallback {
  margin: 0.5rem 0 0;
}
#annonces-screen .annonces-hist-edit-row {
  margin: 0.65rem 0 0;
}
#annonces-screen .annonces-btn-hist-edit {
  padding: 0.42rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(30, 58, 95, 0.38);
  background: rgba(239, 246, 255, 0.9);
  color: #1e3a5f;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
/* Titre de section (lecteurs d’écran) — panneau historique. */
#annonces-screen .annonces-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Grille 3 colonnes : Retour (gauche) — espace centré (badges/ titre si rempli) — actions (droite) */
#annonces-screen:not(.annonces-header-wiz-center-title) .annonces-header-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  width: 100%;
  min-height: 48px;
  column-gap: 8px;
}
#annonces-screen:not(.annonces-header-wiz-center-title) .annonces-header-left {
  grid-column: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  align-self: center;
  gap: 8px;
  min-width: 0;
  justify-self: start;
}
#annonces-screen:not(.annonces-header-wiz-center-title) .annonces-header-center {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 0;
  text-align: center;
}
#annonces-screen:not(.annonces-header-wiz-center-title) .annonces-header-actions {
  grid-column: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  flex: none;
  margin-left: 0;
  justify-self: end;
}

#annonces-screen .annonces-header-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4px;
  justify-self: center;
}

/* Pas de .formulaire-title ici : évite feuille-temps.css (nowrap, overflow:hidden) qui masquait lignes + boutons */
#annonces-screen .annonces-header-title {
  margin: 0;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: clamp(0.88rem, 3.2vw, 1.02rem);
  font-weight: 700;
  color: var(--text, #111827);
  overflow: visible;
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

#annonces-screen .annonces-header-step-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  color: #c9a227;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(184, 134, 11, 0.12);
  border: 1px solid rgba(184, 134, 11, 0.22);
  line-height: 1.1;
}

#annonces-screen .annonces-header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  row-gap: 3px;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
  justify-self: end;
  position: relative;
  z-index: 2;
}

/* --empty : pas de display:none (cassait la 3e colonne du grid → plus de boutons visibles). */

#annonces-screen .annonces-header-action-btn {
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  text-align: center;
}

#annonces-screen .annonces-header-action-btn--ghost {
  background: transparent;
  color: #c9a227;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding-left: 4px;
  padding-right: 4px;
}

#annonces-screen .annonces-header-action-btn--primary {
  background: linear-gradient(135deg, #b8860b 0%, #c9a227 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.28);
}

#annonces-screen .annonces-header-action-btn--publish {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.32);
}

#annonces-screen .annonces-header-action-btn--compact {
  padding: 6px 8px;
  font-size: 0.62rem;
  border-radius: 9px;
}

/* Assistant popup : actions dans le header seulement (pas de barre dupliquée en bas) */
#annonces-screen:has(.annonces-panel-popup-wizard.active:not([hidden])) .annonces-popup-wiz-nav {
  display: none !important;
}

/* Pied d’écran : même style que #note-screen .note-bottom-bar (note.css) —
 * le HTML réutilise .note-bottom-bar, mais seuls #note-screen / #formulaire-screen
 * y sont ciblés ailleurs ; on duplique ici pour le fixe + fond + blur. */
#annonces-screen .note-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  flex-shrink: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
  margin: 0;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#annonces-screen .note-bottom-bar .note-bottom-menu {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  width: 100%;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
#annonces-screen .note-bottom-bar .note-menu-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, background 0.2s;
  min-width: 0;
  border-radius: 0;
  text-align: center;
  text-wrap: balance;
}
#annonces-screen .note-bottom-bar .note-nav-icon {
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
#annonces-screen .note-bottom-bar .note-nav-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 24px;
  min-height: 24px;
  flex-shrink: 0;
  color: inherit;
  stroke: currentColor;
}
/* Libellés sous les icônes (comme Notes / Projet) */
#annonces-screen .note-bottom-bar .note-nav-label {
  display: block;
  width: 100%;
  font-size: 0.7rem;
  font-weight: inherit;
  line-height: 1.2;
  text-align: center;
}

/* Étape choix : pied Popup | Bannière | Coach ; masquer seulement « Écrire » (Historique est en en-tête) */
#annonces-screen.annonces-on-step-choix .annonces-footer-tabs {
  display: none !important;
}
#annonces-screen:not(.annonces-on-step-choix) .annonces-footer-choix {
  display: none !important;
}

/* Étape choix : onglets Popup | Bannière | Coach — aligné sur le ton des cartes (sobre, lisible) */
#annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-bottom-menu {
  gap: 2px;
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  max-width: 34rem;
  margin: 0 auto;
}
#annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-menu-sep {
  opacity: 0.4;
  font-size: 0.95rem;
  color: #9ca3af;
}
#annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-menu-tab {
  border-radius: 10px;
  padding: 10px 8px 7px;
}
#annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-menu-tab.active {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: 600;
}
#annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-menu-tab--coach-logo {
  padding: 6px 10px 6px;
  min-width: 52px;
}
#annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-nav-icon--coach-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  width: 40px;
  height: 40px;
}
#annonces-screen.annonces-on-step-choix .annonces-footer-choix .annonces-footer-choix-coach-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
#app-container.app-theme-night #annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-menu-sep {
  color: #64748b;
}
#app-container.app-theme-night #annonces-screen.annonces-on-step-choix .annonces-footer-choix .note-menu-tab.active {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-weight: 600;
}

#annonces-screen .note-bottom-bar .note-menu-tab:active {
  background: rgba(0, 0, 0, 0.04);
}
#annonces-screen .note-bottom-bar .note-menu-tab.active {
  color: #2563eb;
  font-weight: 600;
}
@media (hover: hover) {
  #annonces-screen .note-bottom-bar .note-menu-tab:hover {
    background: rgba(0, 0, 0, 0.03);
  }
}

/* Séparateur vertical — même principe que #note-screen .note-bottom-bar .note-menu-sep */
#annonces-screen .note-bottom-bar .note-menu-sep {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border, rgba(0, 0, 0, 0.12));
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

#app-container.app-theme-night #annonces-screen .note-bottom-bar {
  background: rgba(30, 41, 59, 0.75);
  border-top-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.25);
}
#app-container.app-theme-night #annonces-screen .note-bottom-bar .note-menu-tab.active {
  color: #60a5fa;
}


.annonces-panel {
  display: none;
}
.annonces-panel.active {
  display: block;
}
.annonces-panel[hidden] {
  display: none !important;
  pointer-events: none;
  visibility: hidden;
}

/* Choix popup / bannière */
#annonces-screen .annonces-panel-choix {
  padding: 0 0.25rem 0.5rem;
  max-width: 28rem;
  margin: 0 auto;
}
#annonces-screen .annonces-choix-heading {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: #111827;
}
#annonces-screen .annonces-choix-subtitle {
  text-align: center;
  margin: 0 auto 1.1rem;
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #4b5563;
}
#annonces-screen .annonces-choix-page-intro {
  max-width: 28rem;
  margin: 0 auto 0.9rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #4b5563;
  text-align: left;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-sizing: border-box;
}
#annonces-screen .annonces-choix-page-intro strong {
  color: #1f2937;
  font-weight: 600;
}
#annonces-screen .annonces-choix-pages {
  min-height: 0;
}
#annonces-screen .annonces-choix-actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 28rem;
  margin: 0 auto 1.5rem;
}
#annonces-screen .annonces-choix-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  width: 100%;
  padding: 1.15rem 1.1rem;
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.12s;
}
#annonces-screen .annonces-choix-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
#annonces-screen .annonces-choix-card:active {
  transform: scale(0.99);
}
#annonces-screen .annonces-choix-card:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
#annonces-screen .annonces-choix-card-icon {
  color: #3b82f6;
  line-height: 0;
  opacity: 0.9;
}
#annonces-screen .annonces-choix-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: #111827;
}
#annonces-screen .annonces-choix-card-desc {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
  max-width: 280px;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-heading {
  color: #f3f4f6;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-subtitle,
#app-container.app-theme-night #annonces-screen .annonces-choix-page-intro {
  color: #9ca3af;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-page-intro {
  background: #1f2937;
  border-color: #374151;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-page-intro strong {
  color: #e5e7eb;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-card {
  background: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
#app-container.app-theme-night #annonces-screen .annonces-choix-card:hover {
  border-color: #4b5563;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-card-title {
  color: #f3f4f6;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-card-desc {
  color: #9ca3af;
}
#app-container.app-theme-night #annonces-screen .annonces-choix-card-icon {
  color: #60a5fa;
}
/* Barre format (après choix) */
#annonces-screen .annonces-format-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid rgba(184, 134, 11, 0.22);
  border-radius: 12px;
}
#annonces-screen .annonces-change-format-btn {
  background: transparent;
  border: none;
  padding: 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c9a227;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#annonces-screen .annonces-change-format-btn:hover {
  color: #d4af37;
}
#annonces-screen .annonces-format-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a7b18;
  margin-left: auto;
}

#annonces-screen .conformite-card .annonces-card-kind-row {
  position: relative;
  display: block;
  margin: 0 0 0.35rem;
  padding-right: 1.75rem;
  min-height: 1.15em;
}
#annonces-screen .conformite-card .annonces-card-kind {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b8860b;
  margin: 0;
  padding-right: 0.25rem;
}
#annonces-screen .conformite-card .annonces-card-remove {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #dc2626;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
  font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.12s ease, opacity 0.12s ease;
  touch-action: manipulation;
  pointer-events: auto;
}
#annonces-screen .conformite-card .annonces-card-remove:hover {
  color: #b91c1c;
}
#annonces-screen .conformite-card .annonces-card-remove:active {
  opacity: 0.65;
}
#app-container.app-theme-night #annonces-screen .conformite-card .annonces-card-remove {
  color: #f87171;
}
#app-container.app-theme-night #annonces-screen .conformite-card .annonces-card-remove:hover {
  color: #fca5a5;
}

/* Page Annonces - formulaire et liste */
#annonces-screen .annonces-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
#annonces-screen .annonces-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}
#annonces-screen .annonces-label-optional {
  font-weight: 500;
  color: #6b7280;
  font-size: 0.88em;
}
#annonces-screen .annonces-input,
#annonces-screen .annonces-textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  box-sizing: border-box;
}
#annonces-screen .annonces-textarea {
  resize: vertical;
}
#annonces-screen .annonces-btn {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
#annonces-screen .annonces-btn-primary {
  background: linear-gradient(135deg, #b8860b 0%, #c9a227 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.35);
}
#annonces-screen .annonces-btn-primary:hover {
  filter: brightness(1.05);
}
#annonces-screen .annonces-btn-primary:active {
  transform: scale(0.98);
}
#annonces-screen .annonces-form-message {
  font-size: 0.9rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0;
}
#annonces-screen .annonces-form-message.success { color: #059669; }
#annonces-screen .annonces-form-message.error { color: #dc2626; }
#annonces-screen .annonces-loading {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 1rem;
}
#annonces-screen .annonces-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
#annonces-screen .annonces-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
#annonces-screen .annonces-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: #1a1a1a;
}
#annonces-screen .annonces-card-meta {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0 0 0.35rem;
}
#annonces-screen .annonces-card-body {
  font-size: 0.9rem;
  color: #374151;
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#annonces-screen .annonces-empty,
#annonces-screen .conformite-empty {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0.5rem 0;
}
#annonces-screen .conformite-card .annonces-card-body {
  font-size: 0.9rem;
  color: #374151;
  margin: 0.35rem 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#annonces-screen .annonces-hist-popup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.65rem 0 0.35rem;
}
#annonces-screen .annonces-badge-popup-on {
  font-size: 0.72rem;
  font-weight: 700;
  color: #c9a227;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: rgba(184, 134, 11, 0.12);
  border: 1px solid rgba(184, 134, 11, 0.25);
}
#annonces-screen .annonces-badge-popup-off {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
#annonces-screen .annonces-badge-banner-on {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e3a5f;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: rgba(30, 58, 95, 0.1);
  border: 1px solid rgba(30, 58, 95, 0.22);
}
#annonces-screen .annonces-badge-banner-off {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
#annonces-screen .annonces-btn-hist-popup,
#annonces-screen .annonces-btn-hist-banner {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(184, 134, 11, 0.45);
  background: rgba(255, 255, 255, 0.95);
  color: #c9a227;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
#annonces-screen .annonces-btn-hist-banner {
  border-color: rgba(30, 58, 95, 0.35);
  color: #1e3a5f;
  background: rgba(239, 246, 255, 0.6);
}
#annonces-screen .annonces-btn-hist-popup--danger {
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.35);
}

/* Message transversal (ex. après publication depuis l’assistant popup) */
#annonces-screen .annonces-feedback {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(184, 134, 11, 0.12);
}

/* Assistant popup — 5 étapes (titre / sous-titre de section : sr-only, voir bloc plus haut) */
#annonces-screen .annonces-popup-wiz-h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #111827;
}
#annonces-screen .annonces-popup-wiz-hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 1rem;
  line-height: 1.4;
}
#annonces-screen .annonces-popup-wiz-hint--tight {
  margin-top: 0.5rem;
  margin-bottom: 0.65rem;
}
#annonces-screen .annonces-popup-appearance-mode {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
#annonces-screen .annonces-popup-preset-wrap {
  margin-top: 0.25rem;
}
#annonces-screen .annonces-popup-custom-wrap {
  margin-top: 0.5rem;
}
#annonces-screen .annonces-popup-custom-fieldset {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}
#annonces-screen .annonces-popup-custom-legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: #9a7b18;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.35rem;
}
#annonces-screen .annonces-popup-custom-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}
#annonces-screen .annonces-popup-custom-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}
#annonces-screen .annonces-popup-cs-color {
  width: 48px;
  height: 36px;
  padding: 2px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  box-sizing: border-box;
}
#annonces-screen .annonces-popup-cs-color:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#annonces-screen .annonces-popup-cs-num {
  max-width: 88px;
  justify-self: end;
}
#annonces-screen .annonces-popup-custom-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.15rem;
  font-size: 0.88rem;
  color: #374151;
  cursor: pointer;
}
#annonces-screen .annonces-popup-preview-mock--custom {
  box-sizing: border-box;
}
#annonces-screen .annonces-popup-appearance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 480px) {
  #annonces-screen .annonces-popup-appearance-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
#annonces-screen .annonces-popup-appearance-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0;
  padding: 0.85rem;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#annonces-screen .annonces-popup-appearance-card:has(input:checked) {
  border-color: rgba(184, 134, 11, 0.65);
  box-shadow: 0 2px 12px rgba(184, 134, 11, 0.15);
}
#annonces-screen .annonces-popup-appearance-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
#annonces-screen .annonces-popup-appearance-preview {
  height: 56px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
#annonces-screen .annonces-popup-appearance-preview--classic {
  background: linear-gradient(180deg, #fff 0%, #f3f4f6 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
#annonces-screen .annonces-popup-appearance-preview--minimal {
  background: #fafafa;
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.06);
}
#annonces-screen .annonces-popup-appearance-preview--accent {
  background: linear-gradient(135deg, #fffbeb 0%, #fde68a 40%, #fff 100%);
  border-color: rgba(180, 134, 11, 0.35);
}
#annonces-screen .annonces-popup-appearance-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #111827;
}
#annonces-screen .annonces-popup-appearance-desc {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.3;
}
#annonces-screen .annonces-popup-radio-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
#annonces-screen .annonces-popup-radio-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  cursor: pointer;
  margin: 0;
  background: rgba(255, 255, 255, 0.9);
}
#annonces-screen .annonces-popup-radio-row:has(input:checked) {
  border-color: rgba(184, 134, 11, 0.45);
  background: rgba(184, 134, 11, 0.06);
}
#annonces-screen .annonces-popup-audience-detail-wrap--nested {
  margin-top: 0.75rem;
}
#annonces-screen .annonces-popup-audience-detail-wrap {
  margin-top: 0.5rem;
}
#annonces-screen .annonces-popup-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
}
#annonces-screen .annonces-popup-check-row input {
  margin-top: 0.2rem;
}
#annonces-screen .annonces-popup-recap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.88rem;
}
#annonces-screen .annonces-popup-recap-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem;
  align-items: start;
}
@media (max-width: 380px) {
  #annonces-screen .annonces-popup-recap-row {
    grid-template-columns: 1fr;
  }
}
#annonces-screen .annonces-popup-recap-k {
  font-weight: 700;
  color: #6b7280;
}
#annonces-screen .annonces-popup-recap-v {
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
}
#annonces-screen .annonces-popup-preview-title-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a7b18;
  margin: 0 0 0.65rem;
}
#annonces-screen .annonces-popup-preview-stage {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  background: linear-gradient(160deg, rgba(0, 0, 0, 0.06) 0%, rgba(184, 134, 11, 0.08) 100%);
  border-radius: 16px;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  margin-bottom: 0.65rem;
  min-width: 0;
  box-sizing: border-box;
}
#annonces-screen .annonces-popup-preview-stage--solo {
  min-height: 240px;
}
#annonces-screen .annonces-popup-preview-stage--compact {
  min-height: 120px;
  padding: 0.85rem 0.5rem;
  margin-bottom: 0;
}
#annonces-screen .annonces-popup-preview-stage--compact .annonces-popup-preview-mock {
  max-width: 280px;
  padding: 0.75rem 0.65rem 0.65rem;
  transform: scale(0.92);
  transform-origin: center center;
}

#annonces-screen .annonces-popup-wiz-step--content {
  display: flex;
  flex-direction: column;
  gap: 0;
}
#annonces-screen .annonces-popup-content-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#annonces-screen .annonces-popup-wiz-step--content .annonces-textarea {
  min-height: 7.5rem;
}
#annonces-screen .annonces-popup-message-count {
  margin: -0.15rem 0 0;
  text-align: right;
  font-size: 0.8rem;
  color: #6b7280;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-message-count {
  color: #9ca3af;
}
#annonces-screen .annonces-popup-image-field {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-field {
  border-top-color: rgba(255, 255, 255, 0.08);
}
#annonces-screen .annonces-popup-image-section-label {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-section-label {
  color: #f3f4f6;
}
#annonces-screen .annonces-popup-image-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
#annonces-screen .annonces-popup-upload {
  position: relative;
}
#annonces-screen .annonces-popup-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  min-height: 5.5rem;
  padding: 1rem 1.1rem;
  text-align: center;
  border: 1.5px dashed rgba(184, 134, 11, 0.4);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 251, 235, 0.5) 100%);
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
#annonces-screen .annonces-popup-upload:focus-within .annonces-popup-upload-label,
#annonces-screen .annonces-popup-upload-label:hover {
  border-color: rgba(184, 134, 11, 0.75);
  background: linear-gradient(165deg, #ffffff 0%, rgba(255, 245, 220, 0.65) 100%);
  box-shadow: 0 2px 12px rgba(184, 134, 11, 0.12);
}
#app-container.app-theme-night #annonces-screen .annonces-popup-upload-label {
  border-color: rgba(212, 175, 55, 0.35);
  background: linear-gradient(165deg, #1f2937 0%, rgba(55, 48, 26, 0.45) 100%);
  color: #e5e7eb;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-upload:focus-within .annonces-popup-upload-label,
#app-container.app-theme-night #annonces-screen .annonces-popup-upload-label:hover {
  border-color: rgba(212, 175, 55, 0.55);
  background: #252f3d;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
#annonces-screen .annonces-popup-upload-icon {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.1rem;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8860b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='9.5' r='1.5' fill='%23b8860b' stroke='none'/%3E%3Cpath d='M21 15l-4.5-4.5-6 6L3 16'/%3E%3C/svg%3E");
  opacity: 0.95;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-upload-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='9.5' r='1.5' fill='%23d4af37' stroke='none'/%3E%3Cpath d='M21 15l-4.5-4.5-6 6L3 16'/%3E%3C/svg%3E");
}
#annonces-screen .annonces-popup-upload-cta {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: 0.01em;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-upload-cta {
  color: #f3f4f6;
}
#annonces-screen .annonces-popup-upload-hint {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.35;
  max-width: 20rem;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-upload-hint {
  color: #9ca3af;
}
#annonces-screen .annonces-popup-image-filename {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: #4b5563;
  text-align: center;
  word-break: break-all;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-filename {
  color: #d1d5db;
}
#annonces-screen .annonces-popup-image-preview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.75rem;
  min-width: 0;
}
#annonces-screen .annonces-popup-image-preview-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(7rem, auto);
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 7rem;
  border-radius: 10px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 55%, #f9fafb 100%);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-preview-slot {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, #1f2937 0%, #111827 50%, #1a2332 100%);
}
#annonces-screen .annonces-popup-image-placeholder,
#annonces-screen .annonces-popup-image-thumb-wrap {
  grid-row: 1;
  grid-column: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  box-sizing: border-box;
}
#annonces-screen .annonces-popup-image-placeholder[hidden],
#annonces-screen #annonces-popup-image-thumb-wrap[hidden] {
  display: none !important;
}
#annonces-screen .annonces-popup-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem 0.9rem;
  text-align: center;
  border: none;
  background: transparent;
  margin: 0;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-placeholder {
  background: transparent;
}
#annonces-screen .annonces-popup-image-placeholder-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
#annonces-screen .annonces-popup-image-placeholder-icon {
  display: block;
  width: 3rem;
  height: 3rem;
  border-radius: 8px;
  background-color: #e2e8f0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.5'%3E%3Crect x='4' y='5' width='16' height='12' rx='1.5'/%3E%3Ccircle cx='8.5' cy='9' r='1' fill='%23cbd5e1' stroke='none'/%3E%3Cpath d='M4 16l4-3 3 2.5 4-3.5 4 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-placeholder-icon {
  background-color: #374151;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.5'%3E%3Crect x='4' y='5' width='16' height='12' rx='1.5'/%3E%3Ccircle cx='8.5' cy='9' r='1' fill='%234b5563' stroke='none'/%3E%3Cpath d='M4 16l4-3 3 2.5 4-3.5 4 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
#annonces-screen .annonces-popup-image-placeholder-word {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-placeholder-word {
  color: #94a3b8;
}
#annonces-screen .annonces-popup-image-placeholder-hint {
  margin: 0;
  max-width: 16rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.3;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-placeholder-hint {
  color: #9ca3af;
}
#annonces-screen .annonces-popup-image-thumb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.65rem;
  margin: 0;
  background: #f0f1f3;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-thumb-wrap {
  background: #0f1729;
}
#annonces-screen .annonces-popup-image-thumb {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(12.5rem, 42vh);
  border-radius: 6px;
  border: 0;
  object-fit: contain;
  object-position: center;
  background: transparent;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-image-thumb {
  background: transparent;
}
#annonces-screen .annonces-popup-image-preview .annonces-popup-image-remove {
  align-self: flex-start;
  margin: 0;
}
#annonces-screen .annonces-popup-image-remove[hidden] {
  display: none !important;
}
#annonces-screen .annonces-popup-image-remove {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(180, 134, 11, 0.45);
  background: rgba(184, 134, 11, 0.08);
  color: #c9a227;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
#annonces-screen .annonces-popup-image-remove:hover {
  background: rgba(184, 134, 11, 0.18);
  color: #9a7b18;
}

#annonces-screen .annonces-popup-preview-image-wrap {
  margin: 0.5rem 0 0.35rem;
  max-width: 100%;
  min-width: 0;
}
#annonces-screen .annonces-popup-preview-image-wrap img {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
}
#annonces-screen .annonces-popup-preview-mock {
  position: relative;
  width: 100%;
  max-width: min(320px, 100%);
  min-width: 0;
  box-sizing: border-box;
  padding: 1.1rem 1rem 1rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  overflow-wrap: anywhere;
}
#annonces-screen .annonces-popup-preview-mock--minimal {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
#annonces-screen .annonces-popup-preview-mock--accent {
  background: linear-gradient(180deg, #fffbeb 0%, #fff 55%);
  box-shadow: 0 12px 36px rgba(180, 134, 11, 0.22);
  border: 2px solid rgba(184, 134, 11, 0.35);
}
#annonces-screen .annonces-popup-preview-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  color: #9ca3af;
  cursor: default;
  padding: 0;
}
#annonces-screen .annonces-popup-preview-mock-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem;
  padding: 0 1.5rem;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}
#annonces-screen .annonces-popup-preview-mock-body {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
#annonces-screen .annonces-popup-preview-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}
#annonces-screen .annonces-popup-sms-opt-wrap {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
#annonces-screen .annonces-popup-sms-opt-row {
  margin: 0;
  align-items: flex-start;
}
#annonces-screen .annonces-popup-sms-opt-row input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
#annonces-screen .annonces-popup-sms-opt-hint {
  margin: 0.5rem 0 0;
}
#app-container.app-theme-night #annonces-screen .annonces-popup-sms-opt-wrap {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}
#annonces-screen .annonces-popup-wiz-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
#annonces-screen .annonces-popup-wiz-nav-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
#annonces-screen .annonces-popup-wiz-nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}
#annonces-screen .annonces-popup-wiz-btn {
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  border: none;
}
#annonces-screen .annonces-popup-wiz-btn--secondary {
  background: transparent;
  color: #c9a227;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#annonces-screen .annonces-popup-wiz-btn--primary {
  background: linear-gradient(135deg, #b8860b 0%, #c9a227 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
}
#annonces-screen .annonces-popup-wiz-publish {
  flex-shrink: 0;
}
#annonces-screen .annonces-popup-wiz-message {
  margin-top: 0.75rem;
}
#annonces-screen .annonces-card-popup-window {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Aperçu bandeau (assistant) : aligné sur le runtime (#app-container .app-annonce-banner*) */
#annonces-screen .annonces-banner-preview-bar {
  margin-top: 0.65rem;
  border-radius: 8px;
  overflow: hidden;
}

/* Compose Coach NDL — modal flottant (app uniquement ; le site a ses styles console) */
body:not(.annonce-gestion-site) .annonce-coach-compose-float-backdrop {
  position: fixed;
  z-index: 12025;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

body:not(.annonce-gestion-site) .annonce-coach-compose {
  display: none;
}

body:not(.annonce-gestion-site) .annonce-coach-compose.annonce-coach-compose--float-open:not([hidden]) {
  display: block;
  position: fixed;
  z-index: 12030;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(22rem, calc(100vw - 24px));
  margin: 0;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  box-sizing: border-box;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
}

body:not(.annonce-gestion-site) .annonce-coach-compose__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #202124;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__input {
  width: 100%;
  min-height: 88px;
  max-height: 200px;
  resize: vertical;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: #202124;
  background: #fafafa;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.7);
  background: #fff;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__send {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #8f7319;
  background: #c9a227;
  color: #1a1508;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #5f6368;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__status {
  margin: 6px 0 0;
  font-size: 0.875rem;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__status--error {
  color: #b91c1c;
}

body:not(.annonce-gestion-site) .annonce-coach-compose__status--ok {
  color: #15803d;
}

/* Compose déplacé sous body : thème nuit via :has(#app-container) */
body:not(.annonce-gestion-site):has(#app-container.app-theme-night) .annonce-coach-compose.annonce-coach-compose--float-open:not([hidden]) {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

body:not(.annonce-gestion-site):has(#app-container.app-theme-night) .annonce-coach-compose__title {
  color: #f1f5f9;
}

body:not(.annonce-gestion-site):has(#app-container.app-theme-night) .annonce-coach-compose__input {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body:not(.annonce-gestion-site):has(#app-container.app-theme-night) .annonce-coach-compose__hint {
  color: #94a3b8;
}
