/* social-maison : composants propres à l'outil, dans le monde de wa-channel
 * (app.css). Même règle : le cerne suffit, pas d'ombre sur blanc, l'orange
 * pour ce qui compte. Le parti pris d'écran : on juge une story en la voyant
 * au format du téléphone, pas en lisant une ligne de base de données. */

.flanc-cta { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
.flanc-cta .ic { width: 16px !important; height: 16px !important; }

/* ─── Vignettes ─── */
.vignette {
  flex: none; width: 40px; aspect-ratio: 9 / 16; border-radius: 7px; overflow: hidden;
  background: var(--section); border: 1px solid var(--filet); display: grid; place-items: center;
  color: var(--mention);
}
.vignette.feed { aspect-ratio: 4 / 5; width: 48px; }
.vignette img, .vignette video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette svg { width: 16px; height: 16px; }

/* ─── Posts ─── */
.post-ligne {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--filet); border-radius: var(--r); background: var(--blanc);
}
.post-ligne + .post-ligne { margin-top: 10px; }
.post-ligne:hover { border-color: #d3cfc6; }
.post-ligne .legende { margin: 5px 0 0; font-size: 14px; color: var(--secondaire); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-ligne .quand { font-weight: 800; font-size: 14.5px; }
.post-ligne .raison { grid-column: 2 / -1; margin: -4px 0 0; font-size: 13.5px; color: var(--rouge); }
.post-ligne .raison.attente { color: var(--orange-texte); }
.groupe-titre { font: 700 11px/1.4 Manrope, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--mention); margin: 26px 0 10px; }
.groupe-titre:first-child { margin-top: 0; }

/* ─── Composer ─── */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.composer .carte label:first-of-type { margin-top: 0; }
.choix-type { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.choix-type button {
  text-align: left; padding: 12px 13px; border: 1px solid var(--filet); border-radius: 12px; background: var(--blanc);
}
.choix-type button b { display: block; font-size: 14.5px; }
.choix-type button span { display: block; font-size: 12px; color: var(--mention); line-height: 1.35; margin-top: 2px; }
.choix-type button:hover { border-color: #cfcac1; }
.choix-type button[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 78, 0, .09); }
.choix-type button[aria-pressed="true"] b { color: var(--orange-texte); }

.selection { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; min-height: 20px; }
.selection .choisi { position: relative; width: 74px; }
.selection .choisi .vignette { width: 74px; border-radius: 10px; }
.selection .choisi .vignette.feed { width: 74px; }
.selection .choisi .outils { display: flex; justify-content: space-between; margin-top: 4px; }
.selection .choisi .outils button { font-size: 12px; font-weight: 800; color: var(--secondaire); padding: 2px 4px; }
.selection .choisi .outils button:hover { color: var(--orange-texte); }
.rang {
  position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--encre); color: var(--blanc); font-size: 11.5px; font-weight: 800; display: grid; place-items: center;
}

.controle { margin: 16px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.controle li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--filet); }
.controle li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.controle li.erreur-c { color: var(--rouge); }
.controle li.avert { color: var(--orange-texte); }
.controle li.bon { color: var(--vert); }
.format-story { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.compte-car { float: right; font-size: 12px; font-weight: 700; color: var(--mention); }
.compte-car.trop { color: var(--rouge); }
.actions-composer { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--filet); }

/* L'aperçu : le téléphone, à l'échelle, tel que l'abonné verra la story. */
.apercu { position: sticky; top: 18px; }
.telephone {
  position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: 30px; overflow: hidden;
  background: var(--noir); border: 7px solid var(--noir); outline: 1px solid var(--filet);
}
.telephone img, .telephone video { width: 100%; height: 100%; object-fit: cover; display: block; }
.telephone .barres-story { position: absolute; top: 10px; left: 10px; right: 10px; height: 2.5px; border-radius: 2px; background: rgba(255,255,255,.35); }
.telephone .barres-story::after { content: ''; position: absolute; inset: 0 62% 0 0; background: #fff; border-radius: 2px; }
.telephone .qui {
  position: absolute; top: 22px; left: 12px; display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 13px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.telephone .qui span { width: 26px; height: 26px; border-radius: 50%; background: var(--orange); border: 1.5px solid #fff; }
.telephone .vide-tel { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 26px; color: var(--noir-doux); font-size: 13.5px; }
.telephone .zone-sure {
  position: absolute; left: 0; right: 0; height: 14%; border-style: dashed; border-color: rgba(140,136,128,.7); border-width: 0;
  pointer-events: none;
}
.telephone .zone-sure.haut { top: 0; border-bottom-width: 1px; }
.telephone .zone-sure.bas { bottom: 0; border-top-width: 1px; }
.apercu-feed { border: 1px solid var(--filet); border-radius: 14px; overflow: hidden; background: var(--blanc); }
.apercu-feed .media { aspect-ratio: 4 / 5; background: var(--section); display: grid; place-items: center; color: var(--mention); font-size: 13.5px; }
.apercu-feed .media img, .apercu-feed .media video { width: 100%; height: 100%; object-fit: cover; }
.apercu-feed .texte { padding: 11px 13px 14px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 190px; overflow: auto; }
.apercu-feed .texte b { margin-right: 6px; }
.apercu-feed .points { display: flex; gap: 4px; justify-content: center; padding-top: 9px; }
.apercu-feed .points i { width: 6px; height: 6px; border-radius: 50%; background: var(--filet); }
.apercu-feed .points i:first-child { background: var(--orange); }
.apercu .aide { margin-top: 10px; }

/* ─── Médiathèque ─── */
.depot {
  border: 1.5px dashed #d6d1c8; border-radius: var(--r); padding: 26px; text-align: center;
  background: var(--section); color: var(--secondaire); font-size: 14.5px; cursor: pointer; margin-bottom: 18px;
}
.depot b { color: var(--encre); }
.depot.survol { border-color: var(--orange); background: var(--orange-fond); }
.depot.compact { padding: 14px; margin: 10px 0 0; font-size: 13.5px; }
.grille-medias { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
.tuile {
  position: relative; border: 1px solid var(--filet); border-radius: 12px; overflow: hidden; background: var(--blanc);
  text-align: left; padding: 0; display: flex; flex-direction: column;
}
.tuile:hover { border-color: #cfcac1; }
.tuile .fond { aspect-ratio: 1; background: var(--section); display: grid; place-items: center; }
.tuile .fond img, .tuile .fond video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tuile .meta { padding: 8px 10px 9px; font-size: 12px; color: var(--mention); line-height: 1.4; }
.tuile .meta b { color: var(--encre); font-size: 12.5px; }
.tuile .ratio {
  position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 99px; background: var(--blanc); border: 1px solid var(--filet);
}
.tuile .ratio.story { border-color: var(--orange-voile); color: var(--orange-texte); }
.tuile[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 78, 0, .12); }
.tuile .actions-tuile { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px 10px; }
.dialog-large { width: min(94vw, 860px) !important; }

/* ─── Calendrier ─── */
.cal-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-tete h2 { text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--filet); border-radius: var(--r); overflow: hidden; }
.cal-jsem { padding: 9px 10px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mention); background: var(--section); border-bottom: 1px solid var(--filet); }
.cal-jour { min-height: 122px; padding: 8px; border-right: 1px solid var(--filet); border-bottom: 1px solid var(--filet); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal-jour:nth-child(7n) { border-right: 0; }
.cal.semaine .cal-jour { min-height: 380px; }
.cal-jour.hors { background: #fbfaf8; }
.cal-jour.hors .cal-num { color: #b6b0a6; }
.cal-jour.survol { background: var(--orange-fond); }
.cal-num { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; }
.cal-num button { width: 24px; height: 24px; border-radius: 7px; color: var(--mention); display: grid; place-items: center; opacity: 0; }
.cal-jour:hover .cal-num button, .cal-num button:focus-visible { opacity: 1; }
.cal-num button:hover { background: var(--section); color: var(--orange-texte); }
.cal-jour.aujourdhui .cal-num span { background: var(--orange); color: var(--encre); border-radius: 99px; padding: 1px 8px; }
.cal-puce {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px; border: 1px solid var(--filet);
  border-radius: 8px; font-size: 12px; text-align: left; background: var(--blanc); min-width: 0;
}
.cal-puce .vignette { width: 18px; border-radius: 4px; }
.cal-puce .vignette.feed { width: 20px; }
.cal-puce span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-puce b { font-weight: 800; flex: none; }
.cal-puce[data-statut="programme"] { border-color: var(--orange-voile); }
.cal-puce[data-statut="publie"] { background: var(--section); }
.cal-puce[data-statut="echoue"] { border-color: rgba(179, 38, 30, .45); color: var(--rouge); }
.cal-puce[draggable="true"] { cursor: grab; }
.cal-legende { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--mention); }
.cal-legende i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--filet); vertical-align: -2px; margin-right: 5px; }

/* ─── Statistiques ─── */
.tuiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1280px) { .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.delta { display: block; margin-top: 7px; font-size: 12.5px; font-weight: 700; color: var(--mention); }
.delta.hausse { color: var(--vert); }
.delta.baisse { color: var(--rouge); }
.graphe { position: relative; width: 100%; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe .axe { font: 500 11px Manrope, sans-serif; fill: var(--mention); }
.graphe .valeur { font: 800 12px Manrope, sans-serif; fill: var(--encre); }
#bulle-graphe {
  position: fixed; z-index: 70; pointer-events: none; background: var(--encre); color: var(--blanc);
  font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}
#bulle-graphe small { display: block; font-weight: 500; color: var(--noir-doux); }
.tab-posts td { vertical-align: middle; }
.tab-posts .num { text-align: right; font-variant-numeric: tabular-nums; }
.tab-posts th.num { text-align: right; }
.tab-posts .cel-media { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.tab-posts .cel-media p { margin: 0; font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.defile { overflow-x: auto; }

/* ─── Stories archivées ─── */
.jour-stories + .jour-stories { margin-top: 26px; }
.jour-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.jour-tete h2 { font-size: 18px; text-transform: capitalize; }
.jour-tete p { margin: 0; font-size: 13.5px; color: var(--mention); }
.bande { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.story-carte { flex: none; width: 132px; text-align: left; padding: 0; scroll-snap-align: start; }
.story-carte .vignette { width: 132px; border-radius: 12px; }
.story-carte .heure { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 12.5px; font-weight: 800; }
.story-carte dl { margin: 5px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; font-size: 12.5px; }
.story-carte dt { color: var(--mention); }
.story-carte dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.story-carte:hover .vignette { border-color: var(--orange); }
.retention { margin-top: 8px; height: 4px; border-radius: 2px; background: var(--section); overflow: hidden; }
.retention i { display: block; height: 100%; background: var(--orange); border-radius: 2px; }

#vue-tableau .story-carte, #vue-tableau .story-carte .vignette { width: 96px; }

/* ─── Leads ─── */
.score { font: 400 22px/1 'Archivo Black', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.score.chaud { color: var(--orange-texte); }
.decompo { display: flex; gap: 6px; flex-wrap: wrap; }
.decompo span { font-size: 12px; font-weight: 700; color: var(--secondaire); padding: 2px 8px; border-radius: 99px; background: var(--section); }
.pseudo { font-weight: 800; color: var(--encre); text-decoration: none; }
.pseudo:hover { color: var(--orange-texte); }
.fil { list-style: none; margin: 14px 0 0; padding: 0; max-height: 46vh; overflow: auto; }
.fil li { padding: 10px 0; border-top: 1px solid var(--filet); font-size: 14px; }
.fil li small { display: block; color: var(--mention); font-size: 12px; margin-bottom: 2px; }

/* ─── Réglages ─── */
.bloc-code {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--section); border: 1px solid var(--filet); margin-top: 8px;
}
.bloc-code code { flex: 1; min-width: 0; color: var(--encre); }
.etapes-meta { counter-reset: m; list-style: none; padding: 0; margin: 12px 0 0; }
.etapes-meta li { counter-increment: m; position: relative; padding: 0 0 14px 34px; font-size: 14.5px; }
.etapes-meta li::before {
  content: counter(m); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--orange-voile); color: var(--orange-texte); font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.compte-ig { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.compte-ig img, .compte-ig .avatar { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--orange); object-fit: cover; background: var(--section); }

@media (max-width: 1100px) {
  .composer { grid-template-columns: 1fr; }
  .apercu { position: static; max-width: 300px; margin: 0 auto; }
}
@media (max-width: 760px) {
  .choix-type { grid-template-columns: repeat(2, 1fr); }
  .post-ligne { grid-template-columns: auto minmax(0, 1fr); }
  .post-ligne .ligne-actions { grid-column: 1 / -1; }
  .post-ligne .raison { grid-column: 1 / -1; margin: 0; }
  .cal-jsem { padding: 7px 4px; font-size: 9.5px; letter-spacing: .06em; text-align: center; }
  .cal-jour { min-height: 74px; padding: 4px; }
  .cal.semaine { grid-template-columns: 1fr; }
  .cal.semaine .cal-jsem { display: none; }
  .cal.semaine .cal-jour { min-height: 0; border-right: 0; }
  .cal:not(.semaine) .cal-puce > span:not(.vignette), .cal:not(.semaine) .cal-puce b { display: none; }
  .cal:not(.semaine) .cal-jour { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 3px; }
  .cal:not(.semaine) .cal-num { width: 100%; }
  .cal:not(.semaine) .cal-puce { width: auto; padding: 2px; border: 0; }
  .cal-num button { opacity: 1; }
  .story-carte { width: 112px; }
  .story-carte .vignette { width: 112px; }
}
