/* ==========================================================================
   Meeple Manager — mobile-first, palette terracotta / sable / crème
   ========================================================================== */
:root {
  --terracotta: #e07a5f;
  --terracotta-dark: #c9583c;
  --sable: #f2cc8f;
  --creme: #fdf7ee;
  --vert: #81b29a;
  --bleu: #6d8ea0;
  --violet: #9b7ebd;
  --rouge: #d94f3d;
  --encre: #3d405b;
  --encre-2: #6b6e8a;
  --carte: #ffffff;
  --bord: #eadfce;
  --ombre: 0 2px 10px rgba(61, 64, 91, .08);
  --radius: 14px;
  --tabbar-h: 62px;
}

/* Mode sombre : celui du téléphone (Auto), ou forcé dans Réglages › Compte (data-theme sur <html>, lot 11) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --creme: #23222b;
    --carte: #2e2d38;
    --bord: #3d3c49;
    --encre: #f0eae0;
    --encre-2: #a5a2b8;
    --sable: #b98d4f;
    --ombre: 0 2px 10px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="sombre"] {
  --creme: #23222b;
  --carte: #2e2d38;
  --bord: #3d3c49;
  --encre: #f0eae0;
  --encre-2: #a5a2b8;
  --sable: #b98d4f;
  --ombre: 0 2px 10px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-theme="clair"] { color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--creme);
  color: var(--encre);
  font-size: 16px;
  line-height: 1.45;
}
h1, h2, h3 { margin: 0; }
a { color: var(--terracotta-dark); }
button, input, select, textarea { font-family: inherit; }

/* ---------- Connexion -------------------------------------------------- */
.login-screen {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, var(--terracotta) 0%, var(--sable) 100%);
}
.login-card {
  background: var(--carte);
  border-radius: 20px;
  padding: 32px 26px;
  width: 100%; max-width: 360px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
}
.login-logo { font-size: 52px; }
.login-card h1 { font-size: 26px; margin: 6px 0 2px; }
.login-sub { color: var(--encre-2); margin: 0 0 20px; }
.login-card input {
  width: 100%; padding: 13px 14px; margin-bottom: 12px;
  border: 1.5px solid var(--bord); border-radius: 10px;
  font-size: 16px; background: var(--creme); color: var(--encre);
}
.login-error { color: var(--rouge); font-size: 14px; margin: 10px 0 0; }

/* ---------- Layout ------------------------------------------------------ */
#app { min-height: 100dvh; }
.main-wrap { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  background: var(--creme);
}
.topbar h1 { font-size: 24px; }
.btn-icon {
  border: none; background: var(--carte); color: var(--encre-2);
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 17px; cursor: pointer; box-shadow: var(--ombre);
}
#view { padding: 0 14px 20px; max-width: 1100px; }

/* Sidebar desktop */
.sidebar { display: none; }
@media (min-width: 900px) {
  #app { display: flex; }
  .sidebar {
    display: block; width: 230px; flex-shrink: 0;
    background: var(--carte); border-right: 1px solid var(--bord);
    min-height: 100dvh; padding: 18px 12px;
    position: sticky; top: 0; align-self: flex-start; height: 100dvh; overflow-y: auto;
  }
  .sidebar-logo { font-size: 20px; font-weight: 700; padding: 4px 10px 18px; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 10px;
    text-decoration: none; color: var(--encre); font-weight: 500;
  }
  .sidebar nav a.active { background: var(--terracotta); color: #fff; }
  .sidebar nav a:not(.active):hover { background: var(--creme); }
  .main-wrap { flex: 1; min-width: 0; padding-bottom: 30px; }
  .tabbar { display: none !important; }
  .fab-wrap { bottom: 26px !important; }
}

/* Barre d'onglets mobile */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex;
  background: var(--carte);
  border-top: 1px solid var(--bord);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--encre-2);
  font-size: 11px; font-weight: 600;
}
.tabbar a .ico { font-size: 21px; }
.tabbar a.active { color: var(--terracotta-dark); }

/* ---------- FAB --------------------------------------------------------- */
.fab-wrap {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.fab {
  width: 58px; height: 58px; border-radius: 50%;
  border: none; background: var(--terracotta); color: #fff;
  font-size: 32px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 18px rgba(201, 88, 60, .45);
  transition: transform .15s;
}
.fab.open { transform: rotate(45deg); background: var(--encre); }
.fab-menu { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.fab-menu button {
  border: none; background: var(--carte); color: var(--encre);
  padding: 11px 16px; border-radius: 24px; font-size: 15px; font-weight: 600;
  cursor: pointer; box-shadow: var(--ombre);
}

/* ---------- Composants --------------------------------------------------- */
.card {
  background: var(--carte); border-radius: var(--radius);
  box-shadow: var(--ombre); padding: 14px 16px; margin-bottom: 12px;
}
.card h2 { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h2 .count {
  background: var(--terracotta); color: #fff; border-radius: 12px;
  font-size: 12px; padding: 1px 9px;
}
.muted { color: var(--encre-2); font-size: 14px; }
.empty { color: var(--encre-2); text-align: center; padding: 26px 10px; font-size: 15px; }

.btn {
  border: none; border-radius: 10px; padding: 11px 16px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--bord); color: var(--encre);
}
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-danger { background: var(--rouge); color: #fff; }
.btn-ghost { background: transparent; color: var(--terracotta-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  border-radius: 10px; padding: 2px 9px; color: #fff; background: var(--encre-2);
  vertical-align: middle;
}
.badge.terracotta { background: var(--terracotta); }
.badge.vert { background: var(--vert); }
.badge.bleu { background: var(--bleu); }
.badge.violet { background: var(--violet); }
.badge.rouge { background: var(--rouge); }
.badge.sable { background: var(--sable); color: var(--encre); }
.badge.gris { background: var(--encre-2); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--encre-2);
  background: var(--creme); border: 1px solid var(--bord);
  border-radius: 20px; padding: 2px 10px;
}

/* Listes d'items cliquables */
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--bord);
  cursor: pointer;
}
.item:last-child { border-bottom: none; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; }
.item .sub { color: var(--encre-2); font-size: 13.5px; margin-top: 1px; }
.avatar {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff; background: var(--terracotta);
}

/* Recherche + filtres */
.search {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1.5px solid var(--bord); border-radius: 12px;
  background: var(--carte); color: var(--encre); margin-bottom: 12px;
}
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; }
.filters button {
  border: 1.5px solid var(--bord); background: var(--carte); color: var(--encre-2);
  border-radius: 20px; padding: 7px 14px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.filters button.active { background: var(--encre); border-color: var(--encre); color: #fff; }

/* ---------- Kanban -------------------------------------------------------- */
.kanban {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 14px; scroll-snap-type: x mandatory;
}
.kanban-col {
  min-width: 270px; max-width: 300px; flex-shrink: 0;
  scroll-snap-align: start;
  background: var(--carte); border-radius: var(--radius);
  padding: 10px; box-shadow: var(--ombre);
}
.kanban-col h3 {
  font-size: 14px; padding: 4px 6px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.kcard {
  background: var(--creme); border: 1px solid var(--bord);
  border-left: 4px solid var(--terracotta);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.kcard.fire { border-left-color: var(--rouge); }
.kcard .title { font-weight: 600; font-size: 14.5px; }
.kcard .sub { font-size: 12.5px; color: var(--encre-2); margin-top: 3px; }
.kcard .actions { display: flex; gap: 6px; margin-top: 8px; }
.kcard.dragover { outline: 2px dashed var(--terracotta); }

/* ---------- Tâches ------------------------------------------------------- */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 11px 4px; border-bottom: 1px solid var(--bord); }
.task:last-child { border-bottom: none; }
.task input[type=checkbox] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--vert); flex-shrink: 0; }
.task .grow { flex: 1; min-width: 0; cursor: pointer; }
.task.done .title { text-decoration: line-through; color: var(--encre-2); }
.prio-haute { color: var(--rouge); font-weight: 700; }
.prio-basse { color: var(--encre-2); }

/* ---------- Formulaires (modale) ------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 28, 40, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--carte); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 92dvh; overflow-y: auto;
}
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; }
}
.modal h2 { font-size: 19px; margin-bottom: 14px; }
.modal label { display: block; font-size: 13.5px; font-weight: 600; color: var(--encre-2); margin: 12px 0 4px; }
.modal input[type=text], .modal input[type=date], .modal input[type=url], .modal input[type=email],
.modal input[type=number], .modal input[type=password], .modal select, .modal textarea {
  width: 100%; padding: 11px 12px; font-size: 16px;
  border: 1.5px solid var(--bord); border-radius: 10px;
  background: var(--creme); color: var(--encre);
}
.modal textarea { min-height: 84px; resize: vertical; }
.modal .row { display: flex; gap: 10px; }
.modal .row > div { flex: 1; min-width: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1.5px solid var(--bord); background: var(--creme); color: var(--encre-2);
  border-radius: 10px; padding: 9px 13px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.seg button.active { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

/* ---------- Toast --------------------------------------------------------- */
.toast-zone { position: fixed; bottom: calc(var(--tabbar-h) + 20px); left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--encre); color: #fff; border-radius: 12px;
  padding: 11px 20px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  animation: toast-in .25s ease;
}
.toast.err { background: var(--rouge); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Dashboard ------------------------------------------------------ */
.stats { display: flex; gap: 10px; margin-bottom: 12px; }
.stat {
  flex: 1; background: var(--carte); border-radius: var(--radius);
  box-shadow: var(--ombre); padding: 12px 8px; text-align: center;
}
.stat .num { font-size: 24px; font-weight: 800; color: var(--terracotta-dark); }
.stat .lbl { font-size: 11.5px; color: var(--encre-2); font-weight: 600; }

/* ---------- Jeux / photos ---------------------------------------------------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.game-card {
  background: var(--carte); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--ombre); cursor: pointer;
}
.game-card .ph {
  aspect-ratio: 4/3; background: var(--bord);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.game-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.game-card .body { padding: 9px 11px 11px; }
.game-card .title { font-weight: 700; font-size: 14.5px; }
.game-card .sub { font-size: 12.5px; color: var(--encre-2); }

.photo-full { width: 100%; border-radius: 12px; margin: 8px 0; }
.stars { color: #e9a13b; letter-spacing: 2px; }

/* ---------- Festival ---------------------------------------------------------- */
.fest-dates {
  background: var(--sable); color: var(--encre);
  border-radius: 10px; padding: 3px 10px; font-weight: 700; font-size: 13px;
  display: inline-block;
}
.reminder { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--bord); }
.reminder:last-child { border-bottom: none; }
.reminder input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--vert); flex-shrink: 0; }
.reminder.done .lbl { text-decoration: line-through; color: var(--encre-2); }
.reminder .lbl { flex: 1; font-weight: 600; }
.reminder .date { font-size: 13px; color: var(--encre-2); }
.reminder.late .date { color: var(--rouge); font-weight: 700; }

/* Détails / fiche */
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-head .avatar { width: 54px; height: 54px; font-size: 22px; }
.detail-head .title { font-size: 21px; font-weight: 800; }
.detail-head .sub { color: var(--encre-2); font-size: 14px; }
.linkrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.back { display: inline-block; margin-bottom: 10px; color: var(--terracotta-dark); text-decoration: none; font-weight: 700; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--bord); position: relative; font-size: 14px; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 14px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--terracotta);
}
.timeline .when { color: var(--encre-2); font-size: 12.5px; }

/* ---------- Calendrier éditorial --------------------------------------------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-daynames { margin-bottom: 4px; }
.cal-daynames div { text-align: center; font-size: 12px; font-weight: 700; color: var(--encre-2); }
.cal-cell {
  min-height: 64px; border: 1px solid var(--bord); border-radius: 8px;
  padding: 3px; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal-empty { border: none; }
.cal-today { border-color: var(--terracotta); border-width: 2px; background: color-mix(in srgb, var(--terracotta) 8%, transparent); }
.cal-num { font-size: 11.5px; font-weight: 700; color: var(--encre-2); }
.cal-today .cal-num { color: var(--terracotta); }
.cal-chip {
  border: none; cursor: pointer; text-align: left; font-size: 10.5px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%;
}
.cal-game { font-weight: 400; opacity: .85; }
@media (max-width: 700px) {
  .cal-cell { min-height: 46px; }
  .cal-game { display: none; } /* mobile : type seul, le titre est dans la modale */
}

/* ---------- Bandeau "à publier sous 7 jours" ---------------------------------- */
.duesoon {
  cursor: pointer; border-left: 5px solid var(--terracotta);
  background: color-mix(in srgb, var(--sable) 30%, var(--carte));
}
.duesoon .title { font-weight: 800; }
.duesoon .sub { color: var(--encre-2); font-size: 13.5px; margin-top: 3px; }
/* Petit texte d'appoint (Réglages…) */
.small { font-size: 13px; }
/* Notifications de l'app (src/notifications.js) */
.notif { position: relative; padding-right: 44px; }
.notif.notif-alerte { border-left-color: var(--rouge); }
.notif.notif-succes { border-left-color: var(--vert); }
.notif.notif-info { border-left-color: var(--bleu); }
.notif .notif-x { position: absolute; top: 8px; right: 8px; }

/* ---------- Sélecteur d'éditeur avec création rapide --------------------------- */
.pubpick-row { display: flex; gap: 8px; align-items: stretch; }
.pubpick-row select { flex: 1; min-width: 0; }
.pubpick-add { white-space: nowrap; }
.pubpick-new {
  margin-top: 8px; padding: 10px 12px 12px;
  border: 1.5px dashed var(--terracotta); border-radius: 12px;
  background: color-mix(in srgb, var(--terracotta) 6%, var(--carte));
  display: flex; flex-direction: column; gap: 8px;
}
.pubpick-title { font-weight: 700; font-size: 14px; }
.modal .pubpick-new .row { gap: 8px; }
.pubpick-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Rappels dans le formulaire jeu */
.rem-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.modal .rem-row input[type=text] { flex: 2; width: auto; min-width: 0; }
.modal .rem-row input[type=date] { flex: 1; width: auto; min-width: 0; }
.chip-btn { cursor: pointer; font-family: inherit; }
.chip-btn:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }

/* ---------- Agenda (accueil) --------------------------------------------------- */
.agenda { display: flex; flex-direction: column; gap: 10px; }
.ag-day { display: grid; grid-template-columns: 108px 1fr; gap: 10px; align-items: start; }
.ag-date {
  font-size: 13px; font-weight: 700; color: var(--encre-2);
  padding-top: 9px;
}
.ag-day.today .ag-date { color: var(--terracotta-dark); }
.ag-day.late .ag-date { color: var(--rouge); }
.ag-items { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--bord); padding-left: 10px; }
.ag-day.today .ag-items { border-left-color: var(--terracotta); }
.ag-day.late .ag-items { border-left-color: var(--rouge); }
.ag-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: var(--creme); border: 1px solid var(--bord); border-radius: 10px; cursor: pointer;
}
.ag-item .title { font-weight: 600; font-size: 14.5px; }
.ag-item .sub { font-size: 12.5px; color: var(--encre-2); }
.ag-ico { font-size: 18px; flex-shrink: 0; }
.ag-item.kind-rappel { border-left: 4px solid var(--sable); }
.ag-day.late .ag-item.kind-rappel { border-left-color: var(--rouge); }
.ag-item.kind-sortie { border-left: 4px solid var(--vert); }
@media (max-width: 520px) {
  .ag-day { grid-template-columns: 1fr; gap: 4px; }
  .ag-date { padding-top: 0; }
}

/* ---------- Veille : sorties campustech ------------------------------------------ */
.rel-head { display: flex; align-items: flex-start; gap: 12px; }
.rel-head .grow { flex: 1; min-width: 0; }
.rel-head .title { font-weight: 800; font-size: 17px; }
.rel-month h2 { position: sticky; top: 58px; background: var(--carte); z-index: 2; padding: 4px 0; text-transform: capitalize; }
.rel { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--bord); }
.rel:last-child { border-bottom: none; }
.rel.is-received { opacity: .78; }
.rel-img {
  width: 76px; height: 76px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
  background: var(--bord); display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.rel-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.rel-thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: contain; background: #fff; flex-shrink: 0; }
.rel-main { flex: 1; min-width: 0; }
.rel-title { font-weight: 700; font-size: 15.5px; }
.rel-sub { font-size: 13.5px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.rel-date { font-weight: 700; }
.rel-date.past { color: var(--encre-2); font-weight: 600; }
.rel-more { font-size: 13.5px; margin-top: 4px; color: var(--encre-2); }
.rel-more summary { cursor: pointer; font-weight: 600; color: var(--terracotta-dark); }
.rel-more .linkrow { margin: 6px 0 0; }
.rel-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.flag {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  border: 1.5px solid var(--bord); border-radius: 20px; padding: 4px 11px 4px 8px;
  font-size: 13px; font-weight: 600; color: var(--encre-2); background: var(--carte);
}
.flag input { width: 16px; height: 16px; margin: 0; accent-color: var(--terracotta); }
.flag.on { border-color: var(--terracotta); color: var(--encre); background: color-mix(in srgb, var(--terracotta) 10%, var(--carte)); }
.flag.auto { cursor: default; border-style: dashed; }
.btn-link {
  border: none; background: none; padding: 0; cursor: pointer; font: inherit;
  color: var(--terracotta-dark); font-weight: 600; font-size: 13px;
}
@media (max-width: 520px) {
  .rel-img { width: 58px; height: 58px; }
}

/* ---------- Audit Instagram (rapport Markdown) --------------------------------- */
.audit-grid-img { width: 100%; max-width: 480px; display: block; margin: 0 auto; border-radius: 10px; border: 1px solid var(--bord); }
.md { line-height: 1.55; font-size: 14.5px; }
.md h2, .md h3, .md h4, .md h5 { margin: 18px 0 8px; line-height: 1.25; }
.md h2 { font-size: 19px; }
.md h3 { font-size: 16.5px; color: var(--terracotta-dark, var(--terracotta)); }
.md h4 { font-size: 15px; }
.md p { margin: 8px 0; }
.md hr { border: none; border-top: 1px solid var(--bord); margin: 16px 0; }
.md ul, .md ol { margin: 8px 0 8px 22px; }
.md li { margin: 4px 0; }
.md blockquote {
  border-left: 4px solid var(--sable); background: color-mix(in srgb, var(--sable) 18%, var(--carte));
  padding: 8px 12px; border-radius: 0 8px 8px 0; margin: 10px 0; color: var(--encre-2);
}
.md pre {
  background: color-mix(in srgb, var(--encre) 6%, var(--carte)); border: 1px solid var(--bord);
  border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 13px; margin: 10px 0;
}
.md code { background: color-mix(in srgb, var(--encre) 7%, var(--carte)); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.md pre code { background: none; padding: 0; }
.md-table { overflow-x: auto; margin: 10px 0; }
.md-table table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md-table th, .md-table td { border: 1px solid var(--bord); padding: 6px 9px; text-align: left; vertical-align: top; }
.md-table th { background: color-mix(in srgb, var(--sable) 25%, var(--carte)); font-weight: 700; }
.sw {
  display: inline-block; width: 13px; height: 13px; border-radius: 4px;
  border: 1px solid var(--bord); vertical-align: -2px; margin-right: 4px;
}
.sw-hex { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* --- Prix Philibert (public/js/views/todos.js → UI.philibert) --- */
.phil-res { flex-basis: 100%; }
.phil-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; }
.phil-item a { text-decoration: none; }

/* --- Éditeur visuel des slides (public/js/views/visual-editor.js) --- */
body.ve-open { overflow: hidden; }
body.ve-open .modal-backdrop { z-index: 1100; }
body.ve-open .toast-zone { z-index: 1200; bottom: 20px; }
.ve-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #1d1f2b; color: #fff;
  touch-action: none; -webkit-user-select: none; user-select: none; }
.ve-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; background: #2a2d3e; }
.ve-title { margin: 0 2px; white-space: nowrap; }
.ve-nav { min-width: 34px; color: #fff; }
.ve-nav:disabled { opacity: .3; }
.ve-etat { font-size: 12.5px; color: #9fa3ba; min-width: 90px; }
.ve-etat.ok { color: #7fd8b4; }
.ve-etat.encours { color: #ffd27a; }
.ve-etat.err { color: #ff8a7a; font-weight: 700; }
.ve-menu { position: relative; }
.ve-menu > summary { list-style: none; }
.ve-menu > summary::-webkit-details-marker { display: none; }
.ve-menu-l { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; display: flex; flex-direction: column; gap: 6px;
  padding: 8px; background: #2a2d3e; border: 1px solid #44485e; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.ve-props { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 7px 12px; background: #24273a; border-top: 1px solid #34384d;
  min-height: 48px; box-sizing: border-box; overflow-x: auto; white-space: nowrap; }
.ve-props select { width: auto; padding: 4px 8px; font-size: 13px; background: #1d1f2b; color: #fff; border: 1px solid #44485e; border-radius: 6px; }
.ve-props input[type=range] { width: 110px; }
.ve-range { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #ddd; }
.ve-props-l { font-size: 13px; color: #b9bccb; }
.ve-props-l b { color: #fff; }
.ve-pastille { color: #FFC933; font-style: normal; font-size: 11px; }
.ve-deborde-l { color: #FF8C1A; font-weight: 700; font-size: 13px; }
.ve-sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #44485e; cursor: pointer; padding: 0; flex: none; }
.ve-sw.on { border-color: #fff; box-shadow: 0 0 0 2px #2EC4A6; }
.ve-main { flex: 1; min-height: 0; display: flex; }
.ve-stage { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden; }
.ve-frame-wrap { position: relative; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.45); background: #fff; }
.ve-frame-wrap iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; overflow: hidden; border-radius: 6px; }
.ve-frame-wrap iframe.ve-tampon { visibility: hidden; }
/* Couche d'édition au-dessus de la slide (même taille que l'aperçu) */
.ve-ui { position: absolute; inset: 0; z-index: 2; touch-action: none; cursor: default; }
.ve-ui.ve-off { pointer-events: none; }
.ve-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.ve-svg .ve-sel { fill: none; stroke: #2EC4A6; stroke-width: 2; stroke-dasharray: 6 4; }
.ve-svg .ve-sel.verrou { stroke: #9fa3ba; }
.ve-svg .ve-sel.masque { stroke: #9fa3ba; stroke-dasharray: 2 4; }
.ve-svg .ve-sel.recadrage { stroke: #FFC933; stroke-dasharray: none; stroke-width: 3; }
.ve-svg .ve-alerte { fill: rgba(255,140,26,.12); stroke: #FF8C1A; stroke-width: 3; }
.ve-svg .ve-zone { fill: rgba(255,140,26,.15); stroke: #FF8C1A; stroke-width: 2; stroke-dasharray: 5 4; }
.ve-svg .ve-guide { stroke: #FF2E93; stroke-width: 1.5; }
.ve-svg .ve-marge { fill: none; stroke: #1F6FEB; stroke-width: 1.5; stroke-dasharray: 6 5; }
.ve-svg .ve-marge-t { fill: #1F6FEB; font: 600 11px system-ui, sans-serif; }
.ve-svg .ve-tige { stroke: #2EC4A6; stroke-width: 2; }
.ve-svg .ve-info { fill: #fff; font: 700 12px system-ui, sans-serif; paint-order: stroke; stroke: #1d1f2b; stroke-width: 3px; }
.ve-h { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; border: 3px solid #2EC4A6;
  box-shadow: 0 1px 4px rgba(0,0,0,.4); touch-action: none; cursor: pointer; z-index: 3; box-sizing: border-box; }
.ve-h::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; } /* zone tactile élargie */
.ve-h.coin { border-radius: 4px; cursor: nwse-resize; }
.ve-h.c1, .ve-h.c3 { cursor: nesw-resize; }
.ve-h.rot { background: #2EC4A6; cursor: grab; }
.ve-h.largeur { width: 14px; height: 26px; margin: -13px 0 0 -7px; border-radius: 7px; cursor: ew-resize; }
.ve-h.cible { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: rgba(255,201,51,.9); border-color: #1D1747; }
.ve-h.cible::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #1D1747; }
.ve-h.depart { background: rgba(255,255,255,.95); border-color: #1D1747; }
.ve-h.courbe { background: #2EC4A6; border-color: #fff; }
.ve-h.on { box-shadow: 0 0 0 4px rgba(46,196,166,.6); }
/* Liste des calques */
.ve-panneau { width: 270px; flex: none; overflow-y: auto; background: #24273a; border-left: 1px solid #34384d; padding: 8px; }
.ve-pan-t { font-weight: 700; font-size: 13px; padding: 4px 6px 8px; }
.ve-ligne { display: flex; align-items: center; gap: 6px; padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.ve-ligne:hover { background: #2f3247; }
.ve-ligne.on { background: #2EC4A633; outline: 1px solid #2EC4A6; }
.ve-ligne.masque .ve-nom { opacity: .45; text-decoration: line-through; }
.ve-ligne.fond { cursor: default; opacity: .55; }
.ve-ico { width: 22px; text-align: center; flex: none; }
.ve-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ve-mini { background: none; border: 0; color: #fff; font-size: 15px; cursor: pointer; padding: 2px 4px; }
.ve-alertes { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 12px; font-size: 13px; color: #FF8C1A; font-weight: 600; }
.ve-alertes:not(:empty) { padding: 6px 12px 8px; background: #2a2016; }
.ve-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; }
.ve-photo { border: 2px solid var(--bord); border-radius: 10px; padding: 4px; background: var(--creme); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.ve-photo:hover { border-color: var(--terracotta); }
.ve-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; }
.ve-photo span { font-size: 12px; color: var(--encre-2); }
.ve-check { display: flex !important; align-items: center; gap: 8px; }
@media (max-width: 700px) {
  .ve-bar { gap: 4px; padding: 6px 8px; flex-wrap: nowrap; overflow-x: auto; }
  .ve-lbl { display: none; }
  .ve-menu-l { position: fixed; top: 50px; right: 8px; }
  .ve-title { font-size: 13px; }
  .ve-etat { min-width: 0; }
  .ve-props input[type=range] { width: 80px; }
  .ve-main { flex-direction: column; }
  .ve-panneau { width: auto; max-height: 38vh; border-left: 0; border-top: 1px solid #34384d; }
  .ve-h { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
}
/* Éditeur : choix d'un logo (marques, éditeurs) */
.ve-logo-choix img { aspect-ratio: 3 / 2; object-fit: contain; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.ve-logo-choix.vide { opacity: .55; cursor: default; }
.ve-logo-choix.vide:hover { border-color: var(--bord); }
.ve-logo-vide { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; border: 1px dashed var(--bord); border-radius: 7px; }

/* --- Story du matin (lot 3) --------------------------------------------------------------- */
.story-fiche { white-space: pre-wrap; font: 15px/1.45 inherit; background: var(--creme, #FBF6EC); border-radius: 10px; padding: 10px 12px; margin: 8px 0; max-height: 280px; overflow: auto; }
.story-reglages { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.story-reglages .grow { min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.story-apercu { width: 216px; height: 384px; flex: none; overflow: hidden; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.story-apercu iframe { width: 1080px; height: 1920px; border: 0; transform: scale(0.2); transform-origin: 0 0; pointer-events: none; }

/* ---------- Statistiques Instagram (public/js/views/statistiques.js) ----------
   Couleur des graphiques : une seule série, terracotta (validée : bande de clarté et contraste, clair et sombre) */
:root { --graphe: #c9583c; --graphe-lavis: rgba(201, 88, 60, .1); --grille: #eee6da; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) { --graphe: #d9694c; --graphe-lavis: rgba(217, 105, 76, .12); --grille: #3d3c49; } }
:root[data-theme="sombre"] { --graphe: #d9694c; --graphe-lavis: rgba(217, 105, 76, .12); --grille: #3d3c49; }
.st-entete { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.st-periodes, .st-actions, .st-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.st-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin-top: 10px; }
.st-tuile { border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; }
.st-chiffre { font-size: 26px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.st-onglets { flex-wrap: wrap; box-shadow: none; padding: 0; margin: 12px 0 0; }
.st-onglets a { flex: 0 1 auto; font-size: 14px; }
.st-grille2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 12px; }
.st-courbe { width: 100%; height: auto; display: block; touch-action: none; }
.st-grille { stroke: var(--grille); stroke-width: 1; }
.st-axe { fill: var(--encre-2); font-size: 11px; }
.st-ligne { fill: none; stroke: var(--graphe); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.st-aire { fill: var(--graphe-lavis); }
.st-point { fill: var(--graphe); stroke: var(--carte); stroke-width: 2; }
.st-reticule { stroke: var(--encre-2); stroke-width: 1; }
.st-barres { display: flex; flex-direction: column; gap: 6px; }
.st-barre { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; }
.st-lib { overflow-wrap: anywhere; }
.st-piste { height: 16px; display: flex; align-items: center; }
.st-rempli { height: 16px; background: var(--graphe); border-radius: 0 4px 4px 0; }
.st-val { font-variant-numeric: tabular-nums; color: var(--encre); min-width: 3.5em; text-align: right; }
.st-tableau { margin-top: 6px; }
.st-scroll { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.st-table th { text-align: left; color: var(--encre-2); font-weight: 600; border-bottom: 1px solid var(--bord); padding: 4px 6px; white-space: nowrap; }
.st-lien { white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.st-table td { border-bottom: 1px solid var(--bord); padding: 5px 6px; }
#st-corps h3 { font-size: 14.5px; margin: 12px 0 4px; }
.st-bulle { position: fixed; z-index: 1000; pointer-events: none; background: var(--carte); color: var(--encre); border: 1px solid var(--bord);
  box-shadow: var(--ombre); border-radius: 8px; padding: 6px 9px; font-size: 13px; max-width: 240px; }

/* ---------- Publication Instagram par l'app (public/js/views/publier-instagram.js) ---------- */
.ig-pub textarea { margin: 4px 0; resize: vertical; }
.ig-pub .notice ul, .ig-recap { margin: 4px 0 0 18px; padding: 0; }
.ig-bloquant { border-left: 4px solid var(--rouge); }
.ig-case { display: flex; gap: 8px; align-items: center; margin: 8px 0 4px; }
.ig-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; }
.ig-tags a { color: inherit; text-decoration: none; margin-left: 4px; }
.texte-rouge { color: var(--rouge); font-weight: 700; }
.tg-cadre { position: relative; max-width: 320px; margin: 6px auto; }
.tg-cadre img { width: 100%; display: block; border-radius: 8px; cursor: crosshair; }
.tg-point { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--terracotta); border: 2px solid #fff; pointer-events: none; }

/* ---------- Concours (public/js/views/concours.js) ---------- */
.cc-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cc-carte { display: flex; gap: 12px; text-decoration: none; color: inherit; margin: 0; }
.cc-carte img, .cc-vide { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; }
.cc-vide { display: flex; align-items: center; justify-content: center; font-size: 32px; background: var(--bord); }
.cc-texte { min-width: 0; }
.cc-texte .title { font-weight: 700; }
.cc-texte .sub { color: var(--encre-2); font-size: 13.5px; margin-top: 2px; }
.cc-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.cc-form h3, #cc-corps h3 { font-size: 14.5px; margin: 14px 0 4px; }
.cc-tuiles { margin: 0 0 12px; }
.cc-cond { margin: 4px 0 0 18px; padding: 0; font-size: 14px; }
.cc-exclu td { color: var(--encre-2); }
.cc-texte-com { max-width: 420px; overflow-wrap: anywhere; }
.cc-actuel td { font-weight: 700; }
.card h3 + .st-scroll, .card h3 + table { margin-top: 4px; }
.tg-verif { border-top: 1px solid var(--bord); margin-top: 12px; padding-top: 4px; }
.tg-auto, .tg-journal { margin: 4px 0 8px 18px; padding: 0; font-size: 14px; }
.tg-verif textarea { margin-top: 4px; resize: vertical; }
.vd-apercu { display: block; width: 100%; max-width: 270px; max-height: 480px; margin-top: 8px; border-radius: 10px; background: #000; }
.sr-ligne { display: grid; grid-template-columns: 150px minmax(160px, 1.3fr) minmax(140px, 1fr) auto auto; gap: 6px; align-items: center; margin-top: 6px; }
@media (max-width: 700px) { .sr-ligne { grid-template-columns: 1fr 1fr; } }
/* Concours, lot 8 : création en 3 champs + Options, fiche Pendant / Après, règlement */
.cc-options { margin: 10px 0; border: 1px solid var(--bord); border-radius: 10px; padding: 8px 12px; }
.cc-options > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.cc-phases { margin: 4px 0 12px; }
.cc-reglement { white-space: pre-wrap; font-family: inherit; font-size: 13.5px; line-height: 1.45; max-height: 40vh; overflow-y: auto; background: var(--sable); border-radius: 10px; padding: 10px 12px; margin: 4px 0 0; }
.cc-reglement-court { background: var(--sable); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 4px 0 6px; }
