/* ========================================================================
   TEMPS MOBILISABLE — CSS
   Sections 1–4 : copie verbatim de grille-tache.css
   Section 5     : surcharges et additions spécifiques à la page marketing
   ======================================================================== */


/* ── 1. TOKENS DE DESIGN (grille-tache.css verbatim) ── */
:root {
  --pg-bg:              #ffffff;
  --pg-surface:         #f9fafb;
  --pg-surface-alt:     #f4f4f3;
  --pg-border:          #ebebea;
  --pg-border-medium:   #d4d4d2;
  --pg-text-primary:    #37352f;
  --pg-text-secondary:  #787774;
  --pg-text-muted:      #b7b7b5;
  --pg-accent:          #12938e;
  --pg-accent-light:    #edfaf9;
  --pg-accent-dim:      rgba(18, 147, 142, 0.10);
  --pg-shadow-xs:       0 1px 2px rgba(0, 0, 0, 0.04);
  --pg-shadow-sm:       0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --pg-shadow-md:       0 4px 8px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
  --pg-radius-xs:       2px;
  --pg-radius-sm:       3px;
  --pg-radius-md:       5px;
  --pg-radius-lg:       6px;
  --pg-font:            -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Grille : 3 semaines (surcharge page) */
  --visible-weeks:  3;
  --grid-template:  11.5rem repeat(3, minmax(0, 1fr));

  /* Couleurs étiquettes */
  --green-bg:  #dcfce7;  --green-bd:  #1faa6c;
  --blue-bg:   #dbeafe;  --blue-bd:   #3b82f6;
  --orange-bg: #ffedd5;  --orange-bd: #f97316;
  --purple-bg: #ede9fe;  --purple-bd: #8b5cf6;
  --pink-bg:   #fce7f3;  --pink-bd:   #ec4899;
  --lime-bg:   #ecfccb;  --lime-bd:   #84cc16;
  --yellow-bg: #fef9c3;  --yellow-bd: #d6a82b;
  --red-bg:    #fee2e2;  --red-bd:    #ef4444;

  /* Jauge de charge (page marketing) */
  --jauge-bg:    #e9edf1;
  --jauge-fill:  #1faa6c;
  --jauge-alert: #ef4444;
}

.planning-container *, .planning-container *::before, .planning-container *::after {
  box-sizing: border-box;
}


/* ── 2. CONTENEUR PRINCIPAL (grille-tache.css verbatim, hauteur auto) ── */

.planning-container {
  font-family: var(--pg-font);
  background: var(--pg-bg);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius-lg);
  box-shadow: var(--pg-shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 1280px;
  margin: 0 auto;
  /* pas de height: calc(100vh) — page marketing, hauteur au contenu */
}


/* ── 3. EN-TÊTE FIXE DES SEMAINES (grille-tache.css verbatim) ── */

.grid-header {
  display: grid;
  grid-template-columns: var(--grid-template, 12rem repeat(var(--visible-weeks, 10), minmax(0, 1fr)));
  grid-auto-rows: 7rem;
  gap: 0.3rem;
  padding: 0.5rem 0.5rem 0.4rem;
  background: var(--pg-bg);
  border-bottom: 1px solid var(--pg-border);
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.grid-header::-webkit-scrollbar { display: none; }


/* ── 4. CONTENU (grille-tache.css verbatim) ── */

.grid-content {
  display: grid;
  grid-template-columns: var(--grid-template, 12rem repeat(var(--visible-weeks, 10), minmax(0, 1fr)));
  grid-auto-rows: 7rem;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem 0.5rem;
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #d4d4d2 transparent;
}

.grid-content::-webkit-scrollbar        { width: 5px; }
.grid-content::-webkit-scrollbar-track  { background: transparent; }
.grid-content::-webkit-scrollbar-thumb  { background: #d4d4d2; border-radius: 10px; }
.grid-content::-webkit-scrollbar-thumb:hover { background: #b7b7b5; }


/* ── 5. CELLULES DE BASE (grille-tache.css verbatim) ── */

.cell {
  background: var(--pg-bg);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius-sm);
  padding: 0;
  box-sizing: border-box;
  min-height: 5rem;
  transition: border-color 0.12s ease;
  text-overflow: clip !important;
  font-family: var(--pg-font);
}

.cell:hover {
  border-color: var(--pg-border-medium);
}


/* ── 6. EN-TÊTE COLONNES SEMAINES (grille-tache.css verbatim) ── */

.header-cell {
  font-family: var(--pg-font);
  background: var(--pg-bg);
  font-weight: 500;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.35rem 0.5rem;
  color: var(--pg-text-secondary);
  line-height: 1.25;
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  transition: border-color 0.12s;
}

.header-cell strong {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pg-text-primary);
}

.header-cell small {
  font-size: 0.69rem;
  color: var(--pg-text-muted);
  font-weight: 400;
}

/* Semaine courante */
.header-cell.current-week-col {
  background: var(--pg-accent-light) !important;
  border-color: var(--pg-accent) !important;
}
.header-cell.current-week-col strong { color: var(--pg-accent) !important; }
.header-cell.current-week-col small  { color: rgba(18, 147, 142, 0.70) !important; }

.cell.current-week-col {
  background: #faffff !important;
  border-color: rgba(18, 147, 142, 0.30) !important;
  border-top: 2px solid var(--pg-accent) !important;
}


/* ── 7. EN-TÊTES DE LIGNES RESSOURCES (grille-tache.css verbatim) ── */

.row-header {
  font-family: var(--pg-font);
  background: var(--pg-bg);
  font-weight: 500;
  padding: 8px 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: var(--pg-text-primary);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius-sm);
  min-height: 5rem;
  font-size: 0.78rem;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.row-header:hover {
  border-color: var(--pg-border-medium);
  box-shadow: var(--pg-shadow-xs);
}

.row-header .preparateur-name {
  font-family: var(--pg-font) !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  line-height: 1.1 !important;
  margin-bottom: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  color: var(--pg-text-primary) !important;
}

.row-header div:not(.preparateur-name):not(.timeline-marge-tooltip) {
  font-family: var(--pg-font) !important;
  font-size: 0.68rem !important;
  color: var(--pg-text-secondary) !important;
  line-height: 1.15 !important;
  margin-bottom: 2px !important;
  word-wrap: break-word;
  hyphens: auto;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-weight: 400 !important;
}

/* Badge contrainte négative */
.row-header .contrainte-negative {
  font-family: var(--pg-font) !important;
  color: #b91c1c !important;
  font-weight: 500 !important;
  background-color: #fff1f2 !important;
  padding: 0 3px !important;
  border-radius: 3px !important;
  border-left: 2px solid #fca5a5 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-block !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  font-size: 0.68rem !important;
  line-height: 1.4 !important;
}


/* ── 8. BOUTONS RESSOURCES / RÉALISATIONS (grille-tache.css verbatim) ── */

.resources-filter-btn {
  font-family: var(--pg-font);
  cursor: pointer !important;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  background: var(--pg-bg);
  border: 1px solid var(--pg-border) !important;
  border-radius: var(--pg-radius-sm) !important;
}
.resources-filter-btn:hover {
  background: var(--pg-surface) !important;
  border-color: var(--pg-border-medium) !important;
  box-shadow: var(--pg-shadow-xs) !important;
}

.resources-content {
  font-family: var(--pg-font);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-weight: 600;
  color: var(--pg-text-primary);
  font-size: 0.82rem;
  gap: 6px;
}
.resources-content svg {
  opacity: 0.45;
  transition: opacity 0.12s;
}
.resources-filter-btn:hover .resources-content svg {
  opacity: 0.80;
}


/* ========================================================================
   SECTION 5 — SPÉCIFIQUE PAGE MARKETING
   ======================================================================== */

/* Cellules de contenu planning (overlay sur .cell) */
.cell.grid-cell {
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* ── Barre d'indisponibilité (verbatim grille-tache.css) ── */
.unavailability-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  border-radius: 0;
  background-image: repeating-linear-gradient(
    45deg,
    #ededed,
    #ededed 8px,
    #d8d8d8 8px,
    #d8d8d8 16px
  );
  border: none;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}

.cell.grid-cell.unavailable {
  background: repeating-linear-gradient(
    45deg,
    #ededed, #ededed 8px,
    #d8d8d8 8px, #d8d8d8 16px
  ) !important;
}

/* ── Barre d'urgence (verbatim grille-tache.css) ── */
.urgency-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  z-index: 15;
  pointer-events: none;
  border-radius: 2px 0 0 2px;
}
.urgency-bar.late { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.35); }
.urgency-bar.soon { background: transparent; box-shadow: none; }

/* Étiquettes — reproduit le style des segments du vrai outil */
.tag {
  flex: 1 1 0;
  border-left: 3px solid #999;
  border-radius: var(--pg-radius-sm);
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  box-shadow: var(--pg-shadow-sm);
  transition: box-shadow 0.12s ease, transform 0.10s ease;
  font-family: var(--pg-font);
}
.tag:hover {
  box-shadow: var(--pg-shadow-md);
  transform: translateY(-1px);
  z-index: 5;
}

/* Largeurs relatives */
.w1 { flex-grow: 1; }
.w2 { flex-grow: 2; }
.w3 { flex-grow: 3; }
.w4 { flex-grow: 4; }

/* Couleurs étiquettes */
.c-green  { background: var(--green-bg);  border-left-color: var(--green-bd);  color: #166534; }
.c-blue   { background: var(--blue-bg);   border-left-color: var(--blue-bd);   color: #1e3a8a; }
.c-orange { background: var(--orange-bg); border-left-color: var(--orange-bd); color: #7c2d12; }
.c-purple { background: var(--purple-bg); border-left-color: var(--purple-bd); color: #4c1d95; }
.c-pink   { background: var(--pink-bg);   border-left-color: var(--pink-bd);   color: #831843; }
.c-lime   { background: var(--lime-bg);   border-left-color: var(--lime-bd);   color: #365314; }
.c-yellow { background: var(--yellow-bg); border-left-color: var(--yellow-bd); color: #713f12; }
.c-red    { background: var(--red-bg);    border-left-color: var(--red-bd);    color: #7f1d1d; }

/* ── Overrides .row-header marketing ──
   .row-header div:not(.preparateur-name) impose white-space:nowrap et overflow:hidden
   sur TOUS les divs enfants, y compris les éléments marketing ci-dessous.
   Ces surcharges rétablissent les comportements corrects. */

.row-header .resource-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: normal !important;
  overflow: visible !important;
  font-size: inherit !important;
  margin-bottom: 4px !important;
}

.row-header .gauge {
  height: 6px !important;
  background: var(--jauge-bg) !important;
  border-radius: 3px !important;
  display: flex !important;
  overflow: hidden !important;
  white-space: normal !important;
  font-size: inherit !important;
  color: inherit !important;
  margin-bottom: 3px !important;
}

.row-header .gauge span {
  display: block;
  height: 100%;
}
.row-header .gauge .seg-green { background: var(--jauge-fill); }
.row-header .gauge .seg-red   { background: var(--jauge-alert); }
.row-header .gauge .seg-empty { background: transparent; }

.row-header .gauge-labels {
  display: flex !important;
  justify-content: space-between !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-size: 0.6rem !important;
  color: var(--pg-text-muted) !important;
  padding: 0 1px !important;
  margin-bottom: 0 !important;
}

/* Dans resource-head, le preparateur-name n'a pas besoin de margin-bottom */
.row-header .resource-head .preparateur-name {
  margin-bottom: 0 !important;
}

/* Badge statut (span, pas div → non ciblé par div:not) */
.status {
  display: none;
}

/* ── Timeline de contraintes (contraintes-display-utils.js → createContraintesGraphHTML) ──
   .row-header div:not(.preparateur-name) impose overflow:hidden !important sur tous les divs.
   Ces overrides rétablissent overflow:visible et suppriment les effets indésirables. */

.row-header .contraintes-timeline-v2,
.row-header .timeline-canvas,
.row-header .timeline-axis,
.row-header .timeline-dates {
  overflow: visible !important;
  margin-bottom: 0 !important;
  white-space: normal !important;
  font-size: inherit !important;
  color: inherit !important;
  font-weight: inherit !important;
}

.row-header .timeline-dates > div {
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin-bottom: 0 !important;
}

.row-header .timeline-dates > div > div {
  overflow: visible !important;
  margin-bottom: 0 !important;
}

.row-header .time-segment {
  overflow: visible !important;
  margin-bottom: 0 !important;
}


/* ── RESPONSIVE : mise à l'échelle uniforme ──
   28.75vw = 11.5rem / 640px × 100 → même ratio que la colonne ressource
   sur desktop. En dessous de 640px, la colonne ressource ET les colonnes
   semaines réduisent ensemble au même rythme → aucun déséquilibre.

   • Sur temps-mobilisable.html : le script matchMedia force le viewport
     à 640px, donc 28.75vw = 184px = 11.5rem → pas de conflit, le
     navigateur scale tout nativement.
   • Sur index.html : viewport = device-width (375px sur iPhone SE),
     donc 28.75vw ≈ 108px → la CSS assure la proportionnalité sans JS.
   ──────────────────────────────────────────────────────────────────── */
html, body {
  margin: 0;
  padding: 0;
}


/* ══════════════════════════════════════════════════════════════
   BLOC QUESTIONS / ACTIONS — Carte insight-panel
   ══════════════════════════════════════════════════════════════ */

/* ─ Carte container ─ */
.insight-panel {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: var(--r-lg, 14px);
  overflow: hidden;
  background: var(--c-bg, #fff);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.04));
}

/* ─ En-tête production (énoncé du problème) ─ */
.insight-dossier {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border, #e5e7eb);
  background: #eff6ff;
}
.insight-dossier-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  flex-shrink: 0;
}
.insight-dossier-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.insight-dossier-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-subtle, #6b7280);
}
.insight-dossier-specs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.insight-dossier-spec {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--c-text-muted, #4b5563);
}
.insight-dossier-spec strong { color: var(--c-text, #111827); font-weight: 600; }
.insight-dossier-spec svg { color: #2563eb; flex-shrink: 0; }
.insight-dossier-sep { color: var(--c-border-strong, #d1d5db); }

/* ─ Ligne question ─ */
.insight-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border, #e5e7eb);
  transition: background 0.15s;
}
.insight-row:hover {
  background: var(--c-bg-alt, #f7f8fa);
}

/* ─ Icône sémantique gauche ─ */
.insight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}
.insight-icon--red  { background: #fff1f2; color: #dc2626; }
.insight-icon--teal { background: #f0fdfa; color: #0f766e; }

/* ─ Texte question ─ */
.insight-question {
  flex: 1;
  font-size: 0.92rem;
  color: var(--c-text-muted, #4b5563);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─ Bouton Voir / Masquer ─ */
.insight-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--r-sm, 6px);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  vertical-align: unset;
  margin-left: 0;
  text-decoration: none;
}
.insight-trigger svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.insight-trigger.is-active svg {
  transform: rotate(90deg);
}

/* Variante rouge (tension) */
.insight-trigger--red {
  background: #fff1f2;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
}
.insight-trigger--red:hover {
  background: #fee2e2;
  border-color: #f87171;
  box-shadow: 0 2px 8px rgba(239,68,68,0.18);
}
.insight-trigger--red.is-active {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 2px 10px rgba(220,38,38,0.32);
}
.insight-trigger--red.is-active:hover { background: #b91c1c; }

/* Variante teal (dispo) */
.insight-trigger--teal {
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  color: #0f766e;
}
.insight-trigger--teal:hover {
  background: #ccfbf1;
  border-color: #2dd4bf;
  box-shadow: 0 2px 8px rgba(20,184,166,0.18);
}
.insight-trigger--teal.is-active {
  background: #0d9488;
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 2px 10px rgba(13,148,136,0.32);
}
.insight-trigger--teal.is-active:hover { background: #0f766e; }

/* ─ Bloc simulation ─ */
.insight-sim {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 16px;
  background: var(--c-bg-alt, #f7f8fa);
}
.insight-sim-intro {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--c-text-subtle, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.insight-sim-intro svg { color: #4338ca; flex-shrink: 0; }

.insight-sim-persons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* ─ Puce personne ─ */
.sim-person {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 6px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 999px;
  border: 1.5px solid var(--c-border, #e5e7eb);
  background: var(--c-bg, #fff);
  color: var(--c-text-muted, #4b5563);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  vertical-align: unset;
  margin-left: 0;
  text-decoration: none;
}
.sim-person:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  color: #4338ca;
  box-shadow: 0 2px 8px rgba(99,102,241,0.16);
}
.sim-person.is-active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #fff;
  box-shadow: 0 2px 10px rgba(79,70,229,0.32);
}
.sim-person.is-active:hover { background: #4338ca; }
.sim-person.is-active .sim-avatar {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

/* ─ Avatar initiale ─ */
.sim-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}


/* ══════════════════════════════════════════════════════════════
   ÉTAT ACTIF — ANIMATIONS PLANNING (inchangé)
   ══════════════════════════════════════════════════════════════ */

/* ─ Aliases backward-compat (style délégué aux classes insight-*) ─ */
.tension-btn, .dispo-btn, .sim-btn { /* visuels gérés par insight-trigger--* et sim-person */ }

/* ── Segments rouges mis en lumière ── */
.tension-active .time-segment.red {
  background: #b91c1c !important;
  border-color: #991b1b !important;
  border-width: 2px !important;
  animation: tension-seg-glow 1.8s ease-in-out infinite;
}
@keyframes tension-seg-glow {
  0%, 100% { box-shadow: 0 0 3px rgba(185,28,28,0.30); }
  50%       { box-shadow: 0 0 9px rgba(185,28,28,0.65); }
}

/* ── Productions cibles mises en lumière ── */
.tension-active .tension-prod,
.tension-active .tension-late-marker {
  outline: 2px solid #dc2626 !important;
  outline-offset: 0;
  z-index: 20 !important;
  animation: tension-prod-glow 1.8s ease-in-out infinite;
}
@keyframes tension-prod-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(220,38,38,0.18); }
  50%       { box-shadow: 0 0 0 5px rgba(220,38,38,0.35); }
}




/* ── Mode dispo-active : simule hover sur S+1 (segment à gauche du 01/06) ── */
/* S+0 et S+1 verts → illuminés (cascade cumulative) */
.dispo-active .time-segment.green[data-week="S+0"],
.dispo-active .time-segment.green[data-week="S+1"] {
  background: #0D9488 !important;
  border-color: #0F766E !important;
  border-width: 2px !important;
}
/* S+2 et au-delà → dimmés */
.dispo-active .time-segment.green[data-week="S+2"],
.dispo-active .time-segment.green[data-week="S+3"],
.dispo-active .time-segment.green[data-week="S+4"] {
  background: #CCFBF1 !important;
  border-color: #94a3b8 !important;
}


/* ════════════════════════════════════════════════════════════════
   BLOC TEMPS MOBILISABLE TERRAIN (.tm-feature)
   Spécifique au 2e article de la section "Décider avec une vision
   claire de la capacité réelle" : Production + Agenda hebdo.
   Toutes les règles sont scopées à .tm-feature pour ne pas affecter
   le 1er article (couleur bleue) ni les autres sections du site.
   ════════════════════════════════════════════════════════════════ */

/* ── Garde-fou anti-overflow horizontal ──
   L'iframe agenda est forcée à width:960px par JS (pour rendre son
   contenu en mode desktop avant scaling). Sans confinement, ce 960px
   se propage via min-width:auto des grid items, élargissant l'article
   puis le body, ce qui déborde sur tout le reste du site.
   → On confine TOUT à l'intérieur de chaque .feature-row-wide
     (ancienne maquette ET nouvelle .tm-feature) en corrigeant le
     min-width:auto par défaut des grid items.
   → overflow:clip sur les articles eux-mêmes pour ne pas casser le
     sticky-header global. */
.feature-row-wide { overflow: clip; }
.feature-row-wide > .feature-text,
.feature-row-wide > .feature-visual { min-width: 0; }
.feature-row-wide .feature-screen { max-width: 100%; }

/* ── Variante orange du dossier (.tm-feature uniquement) ── */
.tm-feature .insight-dossier { background: #fff7ed; }
.tm-feature .insight-dossier-icon {
  background: #ffedd5;
  border-color: #fed7aa;
  color: #ea580c;
}
.tm-feature .insight-dossier-spec svg { color: #f97316; }

/* ── Variante orange icône / bouton ligne question ── */
.tm-feature .insight-icon--grey { background: #fff7ed; color: #f97316; }
.tm-feature .insight-trigger--grey {
  background: #fff7ed; color: #c2410c;
  border: 1px solid #fed7aa;
}
.tm-feature .insight-trigger--grey:hover { background: #ffedd5; }
.tm-feature .insight-trigger--grey.is-active {
  background: #f97316; color: #fff; border-color: #f97316;
}
.tm-feature .insight-trigger--grey.is-active:hover { background: #ea580c; }

/* ── Animations simulation (apparition d'un segment) ── */
@keyframes tmSimEntryAppear {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes tmSimNewPulse {
  0%, 100% { outline: 2px solid transparent; outline-offset: 1px; }
  55%      { outline: 2px solid currentColor; outline-offset: 2px; }
}
.tm-feature .sim-new-entry {
  animation: tmSimEntryAppear 0.35s ease-out,
             tmSimNewPulse 1.6s ease-in-out 0.4s 3;
}

/* ── Iframe agenda : fausse fenêtre dédiée ── */
.tm-feature .feature-screen--agenda {
  overflow: hidden;
  height: 598px;     /* barre 33 + topbar 44 + zone agenda 521 */
  margin-top: 24px;
}
.tm-feature .feature-screen--agenda .agenda-embed {
  display: block;
  border: 0;
  background: #ffffff;
  transform-origin: top left;
}

/* ── Topbar embarquée (Production & Agenda) ── */
.tm-feature .feature-screen .fs-topbar {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid #ebebeb;
  box-sizing: border-box;
  flex-shrink: 0;
}
.tm-feature .feature-screen .fs-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
}
.tm-feature .feature-screen .fs-topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.tm-feature .feature-screen .fs-topbar-right { flex: 1; }
.tm-feature .feature-screen .fs-app-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: #b0b7c3;
  letter-spacing: -0.01em;
  user-select: none;
}
.tm-feature .feature-screen .fs-sep {
  color: #d1d5db;
  font-size: 0.75rem;
  user-select: none;
}
.tm-feature .feature-screen .fs-page-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.02em;
}
.tm-feature .feature-screen .fs-nav-range {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
  letter-spacing: -0.025em;
}
.tm-feature .feature-screen .fs-nav-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}
.tm-feature .feature-screen .fs-nav-year {
  font-size: 0.72rem;
  font-weight: 400;
  color: #9ca3af;
}
.tm-feature .feature-screen .fs-nav-week {
  background: #f3f4f6;
  color: #6b7280;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
}
.tm-feature .feature-screen .fs-topbar .topbar-weeks-divider {
  width: 1px; height: 18px;
  background: #e5e7eb;
  margin: 0 8px;
  flex-shrink: 0;
}
.tm-feature .feature-screen .fs-topbar .topbar-weeks-selector {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 2px;
  gap: 1px;
  flex-shrink: 0;
}
.tm-feature .feature-screen .fs-topbar .topbar-weeks-btn {
  background: none;
  border: none;
  color: #6b7280;
  padding: 0 9px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.695rem;
  font-weight: 600;
  font-family: Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.tm-feature .feature-screen .fs-topbar .topbar-weeks-btn:hover:not(.active) {
  background: rgba(0,0,0,0.06);
  color: #374151;
}
.tm-feature .feature-screen .fs-topbar .topbar-weeks-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 1px rgba(0,0,0,0.06);
}

/* ── Responsive : dégradation topbar agenda ── */
@media (max-width: 900px) {
  /* En layout empilé, on annule le translateY appliqué par centerPanel() */
  .tm-feature #tm-left-panel { transform: none !important; }
}
@media (max-width: 720px) {
  .tm-feature .feature-screen--agenda .fs-topbar { padding: 0 0.75rem; }
  .tm-feature .feature-screen--agenda .fs-topbar-center { gap: 6px; }
  .tm-feature .feature-screen--agenda .fs-nav-range { font-size: 0.8rem; }
  .tm-feature .feature-screen--agenda .fs-nav-year { display: none; }
}
@media (max-width: 600px) {
  .tm-feature .feature-screen--agenda { height: 538px; }
}
@media (max-width: 560px) {
  .tm-feature .feature-screen--agenda .fs-app-name,
  .tm-feature .feature-screen--agenda .fs-sep,
  .tm-feature .feature-screen--agenda .fs-page-name { display: none; }
  .tm-feature .feature-screen--agenda .fs-topbar-left { flex: 0 0 auto; }
  .tm-feature .feature-screen--agenda .topbar-weeks-divider { margin: 0 4px; }
  .tm-feature .feature-screen--agenda .topbar-weeks-btn { padding: 0 7px; font-size: 0.66rem; }
}

/* Smartphone : on cache la topbar Production (la fenêtre Production
   utilise le même zoom que le planning historique via adjustPlanningZoom,
   et la topbar — non zoomée — donnerait un visuel incohérent). Le contexte
   "Production" est déjà fourni par le panneau "Demande d'intervention". */
@media (max-width: 520px) {
  .tm-feature .feature-screen:not(.feature-screen--agenda) .fs-topbar {
    display: none;
  }
}

@media (max-width: 440px) {
  .tm-feature .feature-screen--agenda { height: 520px; }
  .tm-feature .feature-screen--agenda .fs-topbar { padding: 0 0.5rem; height: 40px; }
  .tm-feature .feature-screen--agenda .fs-nav-week { padding: 1px 4px; font-size: 0.66rem; }
  .tm-feature .feature-screen--agenda .fs-nav-range { font-size: 0.74rem; }
  .tm-feature .feature-screen--agenda .topbar-weeks-divider,
  .tm-feature .feature-screen--agenda .topbar-weeks-selector { display: none; }
  .tm-feature .feature-screen--agenda .feature-screen-bar { padding: 9px 11px; }
}
