/* FOOTPASS Messenger v2 · Autorisations (page complète)
   Onglets, cartes mandat/autorisation/délégation, accès par personne, récap.
   Vocabulaire hm-* / pg-* (Modern Black, accent --acc) · classes md-*. */

/* ═══ Onglets (pills défilantes) ═══ */
.md-tabs {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  margin: 2px -18px 12px; padding: 0 44px 0 18px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
}
.md-tabs::-webkit-scrollbar { display: none; }
.md-tab {
  flex-shrink: 0; height: 32px; padding: 0 13px; border-radius: 99px; cursor: pointer;
  font: 650 11.5px/1 'Inter', sans-serif;
  background: var(--fp-surface-2); border: 1px solid var(--fp-border-strong); color: var(--fp-text-3);
}
.md-tab.on { background: #FAFAFA; border-color: var(--fp-text); color: #0F0F0F; }

/* Sous-onglet Reçues / Données */
.md-subrow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.md-subhint { font: 400 10.5px/1.35 'Inter', sans-serif; color: var(--fp-text-4); }

/* ═══ Cartes ═══ */
.md-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.md-card {
  display: flex; flex-direction: column; gap: 9px; width: 100%;
  padding: 12px 13px; border-radius: 16px; cursor: pointer; text-align: left; color: inherit;
  background: var(--fp-surface); border: 1px solid var(--fp-border);
}
.md-card:active { background: var(--fp-active); }
.md-card-top { display: flex; align-items: center; gap: 11px; width: 100%; }
.md-card-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.md-card-who b {
  font: 650 13px/1.25 'Inter', sans-serif; color: var(--fp-text); letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-card-who em {
  font: 400 11px/1.3 'Inter', sans-serif; font-style: normal; color: var(--fp-text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-card-meta {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  padding-top: 9px; border-top: 1px solid var(--fp-hairline);
  font: 400 11px/1.4 'Inter', sans-serif; color: var(--fp-text-3);
}
.md-card-until { color: var(--fp-text-4); font-size: 10.5px; }

/* Chaîne d'autorité (délégations) */
.md-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.md-chain-n {
  padding: 4px 9px; border-radius: 99px;
  font: 600 10.5px/1 'Inter', sans-serif; color: var(--fp-text-2);
  background: var(--fp-hairline);
}
.md-chain-n.me { background: color-mix(in srgb, var(--acc, #00A37E) 15%, transparent); color: var(--acc-bright, #00C49A); }
.md-chain-arr { display: flex; color: #5B5B63; }
.md-chain-arr.big { color: var(--fp-text-4); }

/* Demandes reçues · actions rapides */
.md-req { display: flex; flex-direction: column; }
.md-req-acts { display: flex; gap: 8px; padding: 0 14px 13px 60px; }
.md-req-acts .a3-act { flex: 1; }

/* ═══ Accès par personne ═══ */
.md-legend {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px;
  font: 500 10.5px/1 'Inter', sans-serif; color: var(--fp-text-3);
}
.md-legend span { display: inline-flex; align-items: center; gap: 5px; }
.md-acclist { display: flex; flex-direction: column; width: 100%; padding-top: 3px; border-top: 1px solid var(--fp-hairline); }
.md-accrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 0;
}
.md-accrow em {
  font: 400 11.5px/1.3 'Inter', sans-serif; font-style: normal; color: var(--fp-text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-accmore { padding: 5px 0 1px; font: 500 10.5px/1 'Inter', sans-serif; color: var(--fp-text-4); }
.md-lvls { display: inline-flex; gap: 4px; }
.md-lvl {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--acc, #00A37E) 13%, transparent); color: var(--acc-bright, #00C49A);
}
.md-lvl.no { background: var(--fp-hairline); color: var(--fp-text-4); }

/* ═══ Parties (feuille détail) ═══ */
.md-parties {
  display: flex; align-items: flex-start; justify-content: center; gap: 12px;
  padding: 4px 0 16px;
}
/* La flèche s'aligne sur le centre des avatars (40px) · pas sur le milieu des colonnes */
.md-parties .md-chain-arr.big { margin-top: 13px; }
.md-party { display: flex; flex-direction: column; align-items: center; gap: 3px; max-width: 148px; }
.md-party b { font: 650 13px/1.2 'Inter', sans-serif; color: var(--fp-text); text-align: center; white-space: nowrap; }
/* Identité sous le nom · même vocabulaire que la liste Messages : rôle teinté 600 · structure franche */
.md-party-id { display: block; font: 600 11px/1.35 'Inter', sans-serif; font-style: normal; color: var(--fp-text-3); text-align: center; }
.md-party-id .role { font-weight: 600; font-style: normal; }
.md-party-id .sep { color: #57575F; font-weight: 400; }
.md-party-id .org { color: #EDEDF2; }
.md-party em {
  font: 700 8.5px/1 'Inter', sans-serif; font-style: normal; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--fp-text-4); background: rgba(255,255,255,0.06);
  padding: 4px 8px; border-radius: 99px; margin-top: 3px;
}
.md-party .avatar, .md-party .hm-avatar { margin-bottom: 3px; }

/* ═══ Thème clair ═══ */
.hm.light .md-tab { background: var(--fp-surface); border-color: var(--fp-border-strong); color: var(--fp-text-3); }
.hm.light .md-tab.on { background: #0F0F10; border-color: var(--fp-text); color: #FFFFFF; }
.hm.light .md-subhint { color: var(--fp-text-4); }
.hm.light .md-card { background: var(--fp-surface); border-color: var(--fp-border); }
.hm.light .md-card:active { background: var(--fp-active); }
.hm.light .md-card-who b { color: var(--fp-text); }
.hm.light .md-card-who em { color: var(--fp-text-3); }
.hm.light .md-card-meta { border-top-color: var(--fp-hairline); color: var(--fp-text-2); }
.hm.light .md-card-until { color: var(--fp-text-4); }
.hm.light .md-chain-n { background: rgba(15,15,16,0.05); color: var(--fp-text-2); }
.hm.light .md-chain-n.me { background: color-mix(in srgb, var(--acc, #00A37E) 12%, transparent); color: var(--acc, #00A37E); }
.hm.light .md-chain-arr { color: #B4B4BA; }
.hm.light .md-legend { color: var(--fp-text-3); }
.hm.light .md-acclist { border-top-color: var(--fp-hairline); }
.hm.light .md-accrow em { color: var(--fp-text-2); }
.hm.light .md-lvl { background: color-mix(in srgb, var(--acc, #00A37E) 11%, transparent); color: var(--acc, #00A37E); }
.hm.light .md-lvl.no { background: rgba(15,15,16,0.05); color: var(--fp-text-4); }
.hm.light .md-party b { color: var(--fp-text); }
.hm.light .md-party em { color: #6B6B73; background: rgba(15,15,16,0.05); }
.hm.light .md-party-id .sep { color: #B8B8BE; }
.hm.light .md-party-id .org { color: #2C2C33; }

/* ═══ Intro (philosophie : le badge prouve, il ne bloque rien) ═══ */
.md-intro { margin: 2px 0 14px; font: 400 11.5px/1.55 'Inter', sans-serif; color: var(--fp-text-3); text-wrap: pretty; }
.hm.light .md-intro { color: var(--fp-text-3); }
.md-lvl.mini { width: 16px; height: 16px; border-radius: 5px; margin-right: 5px; vertical-align: -3px; display: inline-flex; }
.md-card-until { display: inline-flex; align-items: center; }
.md-visib { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.md-visib.pub { color: var(--fp-text-4); }
.md-visib.priv { color: var(--fp-text-2); }
.hm.light .md-visib.priv { color: var(--fp-text); }
.md-card-sep { margin: 0 5px; color: var(--fp-text-4); }
.md-fams { margin: 7px 0 2px; gap: 6px; padding-left: 2px; }
.md-fams .hm-chip { height: 24px; padding: 0 9px; font-size: 11px; color: var(--fp-text-3); font-weight: 500; gap: 5px; border-radius: 999px; }
.md-fams .hm-chip.on { font-weight: 600; }
.md-fams .hm-chip-dot { width: 4.5px; height: 4.5px; opacity: 0.8; }
.md-card-also { font: 500 11.5px/1.45 'Inter', sans-serif; color: var(--fp-text-3); }
.hm.light .md-card-also { color: #6B6B73; }

/* ═══ Nouvelle autorisation · groupes de réglages ═══ */
.md-nagroup { margin-bottom: 14px; }
.md-nalbl { display: block; margin-bottom: 7px; font: 700 10px/1 'Inter', sans-serif; letter-spacing: 0.09em; text-transform: uppercase; color: var(--fp-text-4); }
.md-chipset { display: flex; flex-wrap: wrap; gap: 7px; }
.md-chip {
  height: 31px; padding: 0 12px; border-radius: 99px; cursor: pointer;
  font: 600 11.5px/1 'Inter', sans-serif;
  background: var(--fp-surface-2); border: 1px solid var(--fp-border-strong); color: var(--fp-text-3);
}
.md-chip.on { background: #FAFAFA; border-color: var(--fp-text); color: #0F0F0F; }
.md-nahint { display: block; margin-top: 6px; font: 400 10.5px/1.4 'Inter', sans-serif; color: var(--fp-text-4); }
.hm.light .md-nalbl { color: var(--fp-text-4); }
.hm.light .md-chip { background: var(--fp-surface); border-color: var(--fp-border-strong); color: var(--fp-text-3); }
.hm.light .md-chip.on { background: #0F0F10; border-color: var(--fp-text); color: #FFFFFF; }
.hm.light .md-nahint { color: var(--fp-text-4); }

/* ═══ Badge d’autorisation (conversation) ═══ */
.fp-authstrip {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 6px 16px 7px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--acc, #00A37E) 7%, transparent);
  border: none; border-bottom: 1px solid color-mix(in srgb, var(--acc, #00A37E) 14%, transparent);
  color: var(--acc, #00A37E);
}
.fp-authstrip b { font: 700 10.5px/1 'Inter', sans-serif; letter-spacing: 0.01em; white-space: nowrap; }
.fp-authstrip em {
  font: 500 10px/1 'Inter', sans-serif; font-style: normal; opacity: 0.75;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app.dark .fp-authstrip { color: var(--acc-bright, #00C49A); }

/* La pastille de date flottante ne recouvre pas le badge d’autorisation */
.app:has(.fp-authstrip) .thread-floating-date { top: 136px; }

/* ═══ Légende · comment lire l’autorisation ═══ */
.md-legend {
  margin: 14px 0 4px; padding: 13px 14px 12px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
}
.md-legend-title {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font: 650 11px/1 'Inter', sans-serif; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--fp-text-3, #8E8E96);
}
.md-legend-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; }
.md-legend-row b { flex-shrink: 0; width: 78px; font: 600 12.5px/1.3 'Inter', sans-serif; color: var(--fp-text, #FAFAFA); }
.md-legend-row span { font: 400 12px/1.35 'Inter', sans-serif; color: var(--fp-text-3, #8E8E96); }
.md-lg-seg { flex-shrink: 0; width: 8px; height: 8px; border-radius: 2px; transform: translateY(1px); background: var(--acc-bright, #00C49A); }
.md-lg-seg.one { opacity: 0.4; }
.md-lg-seg.two { opacity: 0.7; }
.md-legend-note {
  margin: 9px 0 0; padding-top: 9px; border-top: 1px solid rgba(255,255,255,0.06);
  font: 400 11.5px/1.5 'Inter', sans-serif; color: var(--fp-text-3, #8E8E96); text-wrap: pretty;
}
.hm.light .md-legend { background: rgba(15,15,16,0.025); border-color: rgba(15,15,16,0.08); }
.hm.light .md-legend-row b { color: #1A1A1E; }
.hm.light .md-lg-seg { background: var(--acc, #00A37E); }
.hm.light .md-legend-note { border-top-color: rgba(15,15,16,0.08); }

/* ═══ Polish UX · prise en main instantanée ═══ */
/* État en un coup d'œil · 3 tuiles compteur */
.md-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-radius: 16px; overflow: hidden; margin: 2px 0 16px;
  background: #101013; border: 1px solid rgba(255,255,255,0.07);
}
.md-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 13px 12px 12px; background: none; border: none; cursor: pointer; text-align: left;
  transition: background 140ms, transform 120ms cubic-bezier(0.2, 0, 0, 1);
}
.md-stat + .md-stat { border-left: 1px solid rgba(255,255,255,0.06); }
.md-stat:active { transform: scale(0.97); background: rgba(255,255,255,0.04); }
.md-stat b { font: 750 20px/1 'Inter', sans-serif; letter-spacing: -0.02em; color: var(--fp-text, #FAFAFA); }
.md-stat.ok b { color: var(--acc-bright, #00C49A); }
.md-stat.warn b { color: var(--fp-warn); }
.md-stat.zero b { color: var(--fp-text-4, #6E6E76); }
.md-stat span { font: 500 10.5px/1.25 'Inter', sans-serif; color: var(--fp-text-3, #8E8E96); }
.md-stat.warn.on { background: color-mix(in srgb, var(--fp-warn) 14%, transparent); }
.hm.light .md-stats { background: #FFFFFF; border-color: rgba(15,15,16,0.08); }
.hm.light .md-stat + .md-stat { border-left-color: rgba(15,15,16,0.07); }
.hm.light .md-stat:active { background: rgba(15,15,16,0.05); }
.hm.light .md-stat.ok b { color: var(--acc, #00A37E); }

/* Résumé d'état en un coup d'œil */
.md-sum { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.md-sumchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 99px; border: none;
  font: 650 11px/1 'Inter', sans-serif;
  background: rgba(255,255,255,0.05); color: var(--fp-text-2);
}
button.md-sumchip { cursor: pointer; }
.md-sumchip.warn.on { background: var(--fp-warn); color: #241A05; }
.md-sumchip.ok { background: color-mix(in srgb, var(--acc, #00A37E) 13%, transparent); color: var(--acc-bright, #00C49A); }
.md-sumchip.warn { background: color-mix(in srgb, var(--fp-warn) 13%, transparent); color: var(--fp-warn); }
.hm.light .md-sumchip { background: rgba(15,15,16,0.05); color: var(--fp-text-2); }
.hm.light .md-sumchip.ok { background: color-mix(in srgb, var(--acc, #00A37E) 11%, transparent); color: var(--acc, #00A37E); }
.hm.light .md-sumchip.warn { background: color-mix(in srgb, var(--fp-warn) 12%, transparent); color: var(--fp-warn); }
.md-sumchip.warn.on, .hm.light .md-sumchip.warn.on { background: var(--fp-warn); color: #241A05; }

/* Compteurs dans les onglets */
.md-tab { display: inline-flex; align-items: center; gap: 6px; }
.md-tab i {
  font: 700 9.5px/1 'Inter', sans-serif; font-style: normal;
  padding: 3px 6px; border-radius: 99px;
  background: var(--fp-border-strong); color: var(--fp-text-2);
}
.md-tab.on i { background: rgba(15,15,16,0.12); color: #0F0F0F; }
.hm.light .md-tab i { background: var(--fp-hairline); color: var(--fp-text-2); }
.hm.light .md-tab.on i { background: rgba(255,255,255,0.22); color: #FFFFFF; }

/* Point de statut sur l'avatar (actif = calme, pas de pastille) */
.md-avwrap { position: relative; flex-shrink: 0; display: flex; }
.md-dot {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--acc-bright, #00C49A); border: 2.5px solid var(--fp-surface);
}
.md-dot.warn { background: #E2B248; }
.hm.light .md-dot { border-color: var(--fp-surface); }

/* Jauge de niveau (Information · Négociation · Signature) */
.md-meter { display: inline-flex; gap: 3px; align-items: center; }
.md-meter i { width: 12px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.13); }
.md-meter i.on { background: var(--acc-bright, #00C49A); }
.md-meter.big i { width: 16px; height: 5px; }
.hm.light .md-meter i { background: rgba(15,15,16,0.12); }
.hm.light .md-meter i.on { background: var(--acc, #00A37E); }
.md-permline { display: inline-flex; align-items: center; gap: 7px; font: 400 11px/1 'Inter', sans-serif; color: var(--fp-text-3); }
.md-permline b { font-weight: 650; color: var(--fp-text-2); }
.md-permline em { font-style: normal; color: var(--fp-text-3); }
.hm.light .md-permline b { color: var(--fp-text); }
.hm.light .md-permline em { color: var(--fp-text-3); }

/* Feuille : statut sous les parties + vérification */
.md-herostat { display: flex; align-items: center; justify-content: center; gap: 10px; margin: -6px 0 14px; }
.md-verif { display: inline-flex; align-items: center; gap: 5px; font: 650 10.5px/1 'Inter', sans-serif; color: var(--acc-bright, #00C49A); }
.hm.light .md-verif { color: var(--acc, #00A37E); }

/* Détails & garanties · repliés par défaut */
.md-fold {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid var(--fp-border); color: var(--fp-text-2);
  font: 650 12px/1 'Inter', sans-serif;
}
.md-fold svg { transition: transform 180ms cubic-bezier(0.2, 0, 0, 1); }
.md-fold.open svg { transform: rotate(90deg); }
.hm.light .md-fold { background: rgba(15,15,16,0.03); border-color: var(--fp-border); color: var(--fp-text-2); }
.md-foldbody { animation: mdFold 200ms cubic-bezier(0.2, 0, 0, 1); }
@keyframes mdFold { from { opacity: 0; transform: translateY(-4px); } }

/* Micro-interactions : entrée en cascade + presse */
@media (prefers-reduced-motion: no-preference) {
  .md-list .md-card { animation: mdCardIn 300ms cubic-bezier(0.2, 0, 0, 1) both; }
  .md-list .md-card:nth-child(1) { animation-delay: 0ms; }
  .md-list .md-card:nth-child(2) { animation-delay: 35ms; }
  .md-list .md-card:nth-child(3) { animation-delay: 70ms; }
  .md-list .md-card:nth-child(4) { animation-delay: 105ms; }
  .md-list .md-card:nth-child(5) { animation-delay: 140ms; }
  .md-list .md-card:nth-child(n+6) { animation-delay: 170ms; }
  .md-sum .md-sumchip { animation: mdCardIn 260ms cubic-bezier(0.2, 0, 0, 1) both; }
  .md-sum .md-sumchip:nth-child(2) { animation-delay: 45ms; }
  .md-sum .md-sumchip:nth-child(3) { animation-delay: 90ms; }
}
@keyframes mdCardIn { from { opacity: 0; transform: translateY(7px) scale(0.988); } }
.md-card { transition: transform 130ms cubic-bezier(0.2, 0, 0, 1); }
.md-card:active { transform: scale(0.985); }
.md-tab, .md-chip, .md-sumchip, .a3-act { transition: transform 120ms cubic-bezier(0.2, 0, 0, 1), background 140ms; }
.md-tab:active, .md-chip:active, .a3-act:active, button.md-sumchip:active { transform: scale(0.94); }

/* Récapitulatif · raccourcis vers les onglets */
button.pg-inforow.link {
  width: 100%; background: none; border: none; cursor: pointer; text-align: left;
  transition: background 140ms;
}
button.pg-inforow.link:active { background: var(--fp-active, rgba(255,255,255,0.05)); }
button.pg-inforow.link b svg { width: 7px; height: auto; opacity: 0.7; }
button.pg-inforow.link + button.pg-inforow.link { border-top: 1px solid rgba(255,255,255,0.06); }
.hm.light button.pg-inforow.link + button.pg-inforow.link { border-top-color: rgba(15,15,16,0.07); }

/* Pied de page · retour à la ligne équilibré */
.pg .hm-listfoot { text-wrap: balance; text-align: center; }

/* ═══ Pastille territoire (monogramme façon carte championnat) ═══ */
.md-terr { display: inline-flex; align-items: center; gap: 6px; font-style: normal; color: var(--fp-text-3); font: 400 11px/1 'Inter', sans-serif; min-width: 0; }
.md-terr i {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px; flex-shrink: 0;
  height: 17px; padding: 0 5px 0 4px; border-radius: 5px;
  font: 800 8px/1 'Inter', sans-serif; letter-spacing: 0.06em; font-style: normal;
}
.md-terr i svg { flex-shrink: 0; opacity: 0.95; }
.md-terr.big { font-size: 12px; color: var(--fp-text); font-weight: 600; }
.md-terr.big i { height: 20px; padding: 0 7px 0 5px; font-size: 9px; border-radius: 6px; gap: 4px; }
/* Avatar organisation (club / structure) · carré arrondi, monogramme coloré */
.md-orgav { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 9px; font: 800 12.5px/1 'Inter', sans-serif; letter-spacing: 0.02em; }
.md-orgav.has-img { overflow: hidden; background: #fff; }
.md-orgav img { width: 100%; height: 100%; object-fit: contain; display: block; }
.md-orgav-edit { position: relative; display: inline-block; }
.md-orgav-btn { position: relative; padding: 0; border: 0; background: none; cursor: pointer; display: block; }
.md-orgav-btn:active { transform: scale(0.97); }
.md-orgav-cam { position: absolute; right: -3px; bottom: -3px; width: 21px; height: 21px; border-radius: 50%; background: var(--acc, #00A37E); color: #fff; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #0B0B0D; }
.hm.light .md-orgav-cam { border-color: #fff; }
.md-orghead { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 2px 0 12px; }
.md-orghead b { font: 700 15.5px/1.2 'Inter', sans-serif; letter-spacing: -0.01em; }
.md-orghead em { font: 500 11.5px/1.3 'Inter', sans-serif; color: var(--fp-text-3); font-style: normal; text-align: center; }
/* Badge territoire = vrai logo (compétition / confédération) fourni par l'utilisateur */
.md-terr .md-terr-logo { background: #fff; padding: 2px; height: 17px; min-width: 17px; border-radius: 5px; gap: 0; }
.md-terr .md-terr-logo img { height: 100%; width: auto; max-width: 24px; object-fit: contain; display: block; }
.md-terr.big .md-terr-logo { height: 22px; min-width: 22px; padding: 3px; border-radius: 6px; }
.md-terr.big .md-terr-logo img { max-width: 32px; }
.md-terr-flag { font-size: 10px; line-height: 1; }
.md-terr.big .md-terr-flag { font-size: 13px; }

/* ═══ Fiche autorisation · vue intuitive (résumé + actions) ═══ */
.md-summary { font: 500 15.5px/1.5 'Inter', sans-serif; color: var(--fp-text); letter-spacing: -0.01em; margin-top: 14px; text-wrap: pretty; }
.md-obj { font: 700 15px/1.3 'Inter', sans-serif; color: var(--fp-text); letter-spacing: -0.01em; margin-top: 12px; }
.md-obj.center { text-align: center; }
/* Libellé de section au-dessus des puces niveau · territoire · échéance */
.md-scopelbl { font: 700 10px/1 'Inter', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-text-4); text-align: center; margin-top: 16px; }
.md-chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
/* Fiche autorisation : niveau · territoire · échéance sur UNE seule ligne, centrée */
.md-chiprow.center { justify-content: center; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.md-chiprow.center::-webkit-scrollbar { display: none; }
.md-chiprow.center .md-sumchip { height: 26px; padding: 0 7px; font-size: 10px; gap: 4px; white-space: nowrap; flex-shrink: 0; letter-spacing: 0; }
/* En compact, la pastille code (MON, FR…) du territoire est superflue · le nom suffit */
.md-chiprow.center .md-terr .md-terr-code { display: none; }
.md-chiprow.center .md-terr i { padding: 2px 4px; }
.md-chiprow.center .md-terr { gap: 4px; font-size: 10px; }
.md-sumchip.mut { color: var(--fp-text-3); }
.md-sumchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); font: 600 12px/1 'Inter', sans-serif; color: var(--fp-text); }
.hm.light .md-sumchip { background: rgba(15,15,16,0.03); border-color: rgba(15,15,16,0.10); }

.md-actzone { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.md-act { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); cursor: pointer; text-align: left; transition: transform 120ms ease, background 150ms ease; }
.md-act:active { transform: scale(0.985); }
.md-act.primary { background: color-mix(in srgb, var(--acc-bright,#00C49A) 15%, transparent); border-color: color-mix(in srgb, var(--acc-bright,#00C49A) 30%, transparent); }
.hm.light .md-act { background: rgba(15,15,16,0.025); border-color: rgba(15,15,16,0.09); }
.hm.light .md-act.primary { background: color-mix(in srgb, var(--acc,#00A37E) 10%, #fff); border-color: color-mix(in srgb, var(--acc,#00A37E) 32%, transparent); }
.md-act-ic { flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--acc,#00A37E); color: #fff; }
.md-act-ic.soft { background: rgba(255,255,255,0.08); color: var(--fp-text); }
.hm.light .md-act-ic.soft { background: rgba(15,15,16,0.06); }
.md-act-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.md-act-txt b { font: 650 13px/1.25 'Inter', sans-serif; color: var(--fp-text); }
.md-act-txt em { font: 500 11px/1.3 'Inter', sans-serif; font-style: normal; color: var(--fp-text-3); }
.md-act-go { flex-shrink: 0; color: var(--fp-text-4); display: inline-flex; }

.md-banner { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #E0A93E 15%, transparent); border: 1px solid color-mix(in srgb, #E0A93E 30%, transparent); font: 500 12px/1.4 'Inter', sans-serif; color: var(--fp-text); }
.md-banner-ic { flex-shrink: 0; color: #E0A93E; margin-top: 1px; }
.md-banner b { font-weight: 700; }

.md-livefoot { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.md-revoke-link { align-self: center; background: none; border: 0; cursor: pointer; padding: 6px 10px; font: 600 12.5px/1 'Inter', sans-serif; color: #E5484D; opacity: 0.9; }
.md-revoke-link:active { opacity: 0.6; }
.md-revoke-confirm { padding: 12px 13px; border-radius: 13px; background: color-mix(in srgb, #E5484D 10%, transparent); border: 1px solid color-mix(in srgb, #E5484D 24%, transparent); }
.md-revoke-confirm p { font: 500 12px/1.5 'Inter', sans-serif; color: var(--fp-text); margin: 0 0 10px; }
.md-revoke-acts { display: flex; gap: 8px; }
.md-revoke-acts .pg-btn { flex: 1; }

.md-panel { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; animation: mdPanelIn 200ms cubic-bezier(0.2,0,0,1); }
@keyframes mdPanelIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.md-panel-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; cursor: pointer; padding: 2px; font: 600 12.5px/1 'Inter', sans-serif; color: var(--fp-text-3); transform: rotate(180deg); transform-origin: left center; }
.md-panel-back { transform: none; }
.md-panel-back svg { transform: rotate(180deg); }
.md-panel-h { display: flex; flex-direction: column; gap: 4px; }
.md-panel-h b { font: 700 16px/1.2 'Inter', sans-serif; color: var(--fp-text); letter-spacing: -0.01em; }
.md-panel-h em { font: 500 12px/1.35 'Inter', sans-serif; font-style: normal; color: var(--fp-text-3); }
.md-msg, .md-input { width: 100%; box-sizing: border-box; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.10); color: var(--fp-text); font: 500 13px/1.5 'Inter', sans-serif; padding: 11px 12px; resize: none; }
.hm.light .md-msg, .hm.light .md-input { background: #fff; border-color: rgba(15,15,16,0.14); }
.md-msg:focus, .md-input:focus { outline: none; border-color: var(--acc,#00A37E); }
.md-attach { display: flex; align-items: center; gap: 8px; font: 500 12px/1.3 'Inter', sans-serif; color: var(--fp-text-3); cursor: pointer; }
.md-attach-box { width: 17px; height: 17px; border-radius: 5px; background: var(--acc,#00A37E); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-sizing: border-box; }
.md-attach.off .md-attach-box { background: transparent; border: 1.5px solid rgba(255,255,255,0.25); }
.hm.light .md-attach.off .md-attach-box { border-color: rgba(15,15,16,0.22); }

/* Diffusion · libellés de section + sélection rapide */
.md-blbl-row { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 0; }
.md-blbl-row > span { font: 600 10.5px/1 'Inter', sans-serif; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fp-text-4); }
.md-selall { background: none; border: none; cursor: pointer; padding: 0; font: 650 11px/1 'Inter', sans-serif; color: var(--acc, #00A37E); }
.md-panel .ag-contacts { max-height: 196px; margin: 0; }

/* Aperçu · ce que le destinataire recevra dans Messages (bulle entrante + preuve d’autorisation) */
.md-pv { display: flex; flex-direction: column; align-items: flex-start; }
.md-pv-from { display: flex; align-items: center; gap: 6px; font: 600 10.5px/1 'Inter', sans-serif; color: var(--fp-text-3); margin: 0 0 6px 2px; }
.md-pv-bubble {
  padding: 10px 12px; border-radius: 4px 16px 16px 16px; max-width: 88%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  font: 400 12.5px/1.5 'Inter', sans-serif; color: var(--fp-text); white-space: pre-wrap; overflow-wrap: anywhere;
}
.hm.light .md-pv-bubble { background: #F4F4F2; border-color: rgba(15,15,16,0.07); }
.md-pv-proof {
  display: flex; align-items: center; gap: 9px; max-width: 88%;
  margin-top: 5px; padding: 9px 12px 9px 10px; border-radius: 4px 14px 14px 14px;
  background: color-mix(in srgb, var(--acc, #00A37E) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc, #00A37E) 22%, transparent);
}
.md-pv-proof > i { color: var(--acc, #00A37E); display: flex; flex-shrink: 0; }
.md-pv-proof b { display: block; font: 650 11px/1.25 'Inter', sans-serif; color: var(--fp-text); }
.md-pv-proof em { display: block; font: 500 10px/1.35 'Inter', sans-serif; font-style: normal; color: var(--fp-text-3); }
.md-field { display: flex; flex-direction: column; gap: 7px; }
.md-field > label { font: 600 11px/1 'Inter', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fp-text-4); display: flex; gap: 5px; align-items: center; }
.md-opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
.md-seg { display: flex; gap: 6px; }
.md-seg button { flex: 1; height: 38px; border-radius: 11px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.10); color: var(--fp-text-3); font: 600 13px/1 'Inter', sans-serif; cursor: pointer; }
.md-seg button.on { background: var(--fp-text); border-color: var(--fp-text); color: var(--fp-bg,#0B0B0D); }
.hm.light .md-seg button { background: #fff; border-color: rgba(15,15,16,0.14); }
.hm.light .md-seg button.on { background: #0F0F10; border-color: #0F0F10; color: #fff; }
.md-note { font: 500 11.5px/1.5 'Inter', sans-serif; color: var(--fp-text-3); margin: 0; }

.md-sent { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 20px 8px 8px; animation: mdSentIn 340ms cubic-bezier(0.2,0,0,1); }
@keyframes mdSentIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.md-sent-ic { width: 58px; height: 58px; border-radius: 50%; background: var(--acc,#00A37E); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--acc,#00A37E) 60%, transparent); }
.md-sent b { font: 700 17px/1.2 'Inter', sans-serif; color: var(--fp-text); }
.md-sent em { font: 500 12.5px/1.35 'Inter', sans-serif; font-style: normal; color: var(--fp-text-3); }
.md-sent .pg-btn { margin-top: 8px; min-width: 150px; }
.hm.light .md-terr { color: var(--fp-text-3); }
.hm.light .md-terr.big { color: var(--fp-text); }

/* ═══ Sélecteur territoire · fil d'Ariane + cartes championnat ═══ */
.md-terrpick { display: flex; flex-direction: column; gap: 10px; }
.md-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.md-crumb {
  padding: 5px 10px; border-radius: 99px; border: none; cursor: pointer;
  font: 600 10.5px/1 'Inter', sans-serif;
  background: var(--fp-hairline); color: var(--fp-text-3);
}
.md-crumb.on { background: color-mix(in srgb, var(--acc, #00A37E) 15%, transparent); color: var(--acc-bright, #00C49A); }
.hm.light .md-crumb { background: rgba(15,15,16,0.05); color: var(--fp-text-2); }
.hm.light .md-crumb.on { background: color-mix(in srgb, var(--acc, #00A37E) 12%, transparent); color: var(--acc, #00A37E); }

.md-leagues { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.md-league {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 11px 12px; border-radius: 14px; cursor: pointer; text-align: left; color: inherit;
  background: var(--fp-surface-2); border: 1px solid var(--fp-border-strong);
  animation: mdCardIn 260ms cubic-bezier(0.2, 0, 0, 1) both;
}
.md-league:nth-child(2) { animation-delay: 30ms; } .md-league:nth-child(3) { animation-delay: 60ms; }
.md-league:nth-child(4) { animation-delay: 90ms; } .md-league:nth-child(n+5) { animation-delay: 115ms; }
.md-league.on { border-color: var(--acc, #00A37E); background: color-mix(in srgb, var(--acc, #00A37E) 8%, var(--fp-surface-2)); }
.md-league:active { transform: scale(0.97); }
.md-league-badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 24px; min-width: 30px; padding: 0 7px; border-radius: 8px; margin-bottom: 5px;
  font: 800 10px/1 'Inter', sans-serif; letter-spacing: 0.07em; font-style: normal;
}
.md-league b {
  max-width: 100%; font: 650 12px/1.25 'Inter', sans-serif; color: var(--fp-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-league em {
  font: 400 10px/1.3 'Inter', sans-serif; font-style: normal; color: var(--fp-text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.md-league-more { position: absolute; top: 12px; right: 11px; color: var(--fp-text-4); display: flex; }
.hm.light .md-league { background: var(--fp-surface); border-color: rgba(15,15,16,0.09); }
.hm.light .md-league.on { border-color: var(--acc, #00A37E); background: color-mix(in srgb, var(--acc, #00A37E) 5%, #FFFFFF); }
.hm.light .md-league b { color: var(--fp-text); }
.hm.light .md-league em { color: var(--fp-text-3); }

.md-terrsel {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px dashed rgba(255,255,255,0.14);
}
.md-terrsel > span { font: 600 10px/1 'Inter', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-text-4); }
.hm.light .md-terrsel { background: rgba(15,15,16,0.03); border-color: rgba(15,15,16,0.16); }
.hm.light .md-terrsel > span { color: var(--fp-text-4); }

/* Le composant recherche canonique, ajusté au gabarit des sous-pages */
.pg .hm-search { margin: 0 0 14px; }

/* ═══ Autorisation envoyée dans le fil (preuve de représentation) ═══ */
.fpcard.authproof{display:flex;flex-direction:column;gap:10px;min-width:258px}
.ap-who{display:flex;align-items:center;gap:11px}
.ap-whotxt{display:flex;flex-direction:column;gap:3px;min-width:0}
.ap-whotxt b{font:650 15px/1.15 'Inter',sans-serif;letter-spacing:-.015em;white-space:nowrap}
.ap-whotxt em{font:500 12px/1.2 'Inter',sans-serif;font-style:normal;opacity:.82;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ap-proof{display:flex;align-items:center;gap:6px;color:var(--acc,#00A37E);font:700 11px/1 'Inter',sans-serif;letter-spacing:.01em}
.bubble.sent .ap-proof{color:var(--acc-bright,#00C49A)}
.app.dark .bubble.sent .ap-proof{color:var(--acc,#00A37E)}
.app.dark .bubble.received .ap-proof{color:var(--acc-bright,#00C49A)}
.ap-proof i{font-style:normal;font-weight:550;color:#6E6E76}
.bubble.sent .ap-proof i{color:#ABABB2}
.app.dark .bubble.sent .ap-proof i{color:#6E6E76}
.app.dark .bubble.received .ap-proof i{color:#ABABB2}
.ap-proof i::before{content:'\00b7';padding-right:5px;opacity:.6}
.fpcard.authproof .fpcard-action{margin-top:1px}

/* ═══ Feuille « Envoyer une autorisation » ═══ */
.md-picklist{display:flex;flex-direction:column;margin-top:4px}
.md-pickrow{display:flex;align-items:center;gap:11px;width:100%;padding:11px 2px;background:none;border:none;border-bottom:1px solid rgba(255,255,255,.07);cursor:pointer;text-align:left;color:inherit}
.app.light .md-pickrow,.md-pickrow.light{border-bottom-color:rgba(15,15,16,.08)}
.md-pickrow:last-child{border-bottom:none}
.md-pickmain{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.md-pickmain b{font:650 13.5px/1.15 'Inter',sans-serif}
.md-pickmain em{font:500 11.5px/1.25 'Inter',sans-serif;font-style:normal;opacity:.62}
.md-pickend{margin-left:auto;flex-shrink:0}
