/* Comptes entre Amis — 2F.9.80
 * Harmonisation STRICTEMENT VISUELLE du detail des budgets.
 * Aucun style des dialogues, formulaires, couvertures et mecanismes de synchronisation
 * n'est modifie. Les SVG de couleur existants sont conserves tels quels.
 */

/* 1. Rythme general des ecrans du budget : sans toucher a l'accueil. */
body.cea-body .cea-main:has(> .cea-projectbanner) {
  --cea-detail-ink: #182b40;
  --cea-detail-muted: #718196;
  --cea-detail-border: #e6edf5;
}
body.cea-body .cea-main:has(> .cea-projectbanner) > .cea-back {
  margin-bottom: 13px;
  display: inline-flex;
  align-items: center;
}
body.cea-body .cea-main > .cea-projectbanner {
  border-radius: 22px;
  min-height: 160px;
}
body.cea-body .cea-main > .cea-projectbanner .cea-bannerbody {
  padding: 22px 25px;
}
body.cea-body .cea-main > .cea-projectbanner .cea-bannerbody h1 {
  line-height: 1.16;
  letter-spacing: -.025em;
}
body.cea-body .cea-main > .cea-summary-detail {
  padding: 22px 26px;
  border-radius: 21px;
  background: linear-gradient(112deg, #2580db 0%, #16bdd9 100%);
}
body.cea-body .cea-main > .cea-summary-detail strong {
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
body.cea-body .cea-main > .cea-report-link {
  margin: 9px 0 13px;
}
body.cea-body .cea-main > .cea-report-link a {
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
}
body.cea-body .cea-main > .cea-tabs {
  margin: 13px 0 22px;
  border-radius: 17px;
  padding: 5px;
  gap: 5px;
}
body.cea-body .cea-main > .cea-tabs a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 13px;
}
body.cea-body .cea-main > .cea-section {
  margin-top: 23px;
}
body.cea-body .cea-main > .cea-section > .cea-sectiontitle {
  margin-bottom: 13px;
}
body.cea-body .cea-main > .cea-section > .cea-sectiontitle h2 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.035em;
  color: var(--cea-detail-ink, #182b40);
}

/* 2. Participants : grille de petites cartes cliquables, proche de SwiftUI.
 * Aucun changement d'identifiant, de role, de couleur ou d'action. */
body.cea-body .cea-main > .cea-section > .cea-membergrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  align-items: stretch;
}
body.cea-body .cea-main .cea-membergrid > button.cea-membercard.cea-memberclick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
  min-height: 192px;
  padding: 17px 11px 13px;
  text-align: center;
  border: 1px solid var(--cea-detail-border, #e6edf5);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(24,57,93,.045);
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-top {
  width: 100%;
  display: contents;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-avatar.cea-avatar-pictogram {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  margin: 0 0 9px;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: none;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-avatar.cea-avatar-pictogram img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard > strong {
  display: block !important;
  min-height: 0;
  margin: 0 0 7px;
  max-width: 100%;
  font-size: 15px !important;
  font-weight: 720 !important;
  line-height: 1.22 !important;
  color: #182b40 !important;
  -webkit-text-fill-color: #182b40 !important;
  overflow-wrap: anywhere;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-parts {
  order: 2;
  padding: 0;
  margin: 0 0 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8290a0;
  font-size: 12px;
  font-weight: 500;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-total {
  order: 3;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-total-amount {
  max-width: 100%;
  font-size: 17px;
  font-weight: 740;
  line-height: 1.3;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: #13283d;
  overflow-wrap: anywhere;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-total-label {
  font-size: 11px;
  line-height: 1.2;
  color: #7d8b99;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-foot {
  order: 4;
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
  font-size: 10px;
  color: #667e95;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-foot span:last-child {
  display: none;
}
body.cea-body .cea-main .cea-membergrid > .cea-membercard:focus-visible {
  outline: 3px solid #148df0;
  outline-offset: 3px;
}

/* 3. Depenses : lignes denses, titres bien contrastes, montant aligne.
 * Les boutons d'ouverture de fiche et les badges justificatifs restent identiques. */
body.cea-body .cea-main > .cea-section > .cea-list {
  border-radius: 20px;
  border: 1px solid var(--cea-detail-border, #e6edf5);
  background: #fff;
  box-shadow: 0 6px 20px rgba(24,57,93,.04);
}
body.cea-body .cea-main > .cea-section > .cea-list > button.cea-expenseitem.cea-v3-expense-button {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: 15px minmax(0,1fr) auto minmax(0,max-content) !important;
  align-items: center;
  justify-content: stretch;
  column-gap: 10px !important;
  padding: 15px 17px;
  min-height: 72px;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid #e9edf2;
  background: #fff !important;
  color: #182b40;
}
body.cea-body .cea-main > .cea-section > .cea-list > button.cea-expenseitem.cea-v3-expense-button:last-child {
  border-bottom: 0;
}
body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > .cea-expense-payer-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  min-width: 15px;
  max-width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
}
body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > .cea-expense-payer-symbol img {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}
body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: initial;
  margin: 0;
}
body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > span:nth-child(2) > strong {
  display: block;
  margin: 0;
  font-size: 14px;
  line-height: 1.34;
  font-weight: 700;
  color: #182b40;
  overflow-wrap: anywhere;
}
body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > span:nth-child(2) > span {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #7b8794;
}
body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > .cea-justificatif-badge {
  grid-column: 3;
  margin: 0 !important;
  min-width: 35px !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 3px 6px !important;
  flex-shrink: 0;
}
body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > b {
  grid-column: 4;
  margin: 0;
  font-size: 14px;
  font-weight: 740;
  line-height: 1.2;
  white-space: nowrap;
  color: #172c42;
  font-variant-numeric: tabular-nums;
}

/* 4. Bilan : style de la version native, sans toucher aux calculs. */
body.cea-body .cea-main > .cea-section > .cea-list > .cea-balancerow {
  min-height: 59px;
  padding: 15px 18px;
  gap: 10px;
  border-bottom: 1px solid #e9edf2;
  color: #253549;
}
body.cea-body .cea-main > .cea-section > .cea-list > .cea-balancerow:last-child {
  border-bottom: 0;
}
body.cea-body .cea-main .cea-balancerow > strong {
  font-size: 15px;
  font-weight: 580;
}
body.cea-body .cea-main .cea-balancerow > b {
  margin-left: auto;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}
body.cea-body .cea-main .cea-balancerow .cea-small-dot,
body.cea-body .cea-main .cea-balancerow .cea-transfer-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: none;
  border-radius: 50%;
}
body.cea-body .cea-main .cea-balancerow .cea-small-dot img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}
body.cea-body .cea-main .cea-balancerow .cea-transfer-people {
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}
body.cea-body .cea-main .cea-balancerow .cea-transfer-person {
  font-size: 14px;
  font-weight: 560;
  gap: 6px;
}
body.cea-body .cea-main .cea-balancerow .cea-transfer-arrow {
  color: #7f8b9b;
  font-size: 18px;
  font-weight: 400;
}
body.cea-body .cea-main > .cea-section > .cea-muted {
  font-size: 12px;
  line-height: 1.55;
  color: #7b8898;
}

/* 5. Mobile : cartes participants sur 3 colonnes, et en-tete plus court. */
@media (max-width: 700px) {
  body.cea-body .cea-main > .cea-back { margin-bottom: 10px; }
  body.cea-body .cea-main > .cea-projectbanner {
    min-height: 140px;
    border-radius: 21px;
  }
  body.cea-body .cea-main > .cea-projectbanner .cea-bannerbody {
    padding: 18px 19px;
  }
  body.cea-body .cea-main > .cea-projectbanner .cea-bannerbody h1 {
    font-size: clamp(22px, 5.6vw, 30px);
    line-height: 1.17;
  }
  body.cea-body .cea-main > .cea-project-tools {
    margin-top: 9px;
    margin-bottom: 5px;
    gap: 8px;
  }
  body.cea-body .cea-main .cea-project-tools .cea-share-budget {
    min-height: 39px;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
  }
  body.cea-body .cea-main > .cea-summary-detail {
    margin-top: 11px;
    padding: 18px 20px;
    border-radius: 20px;
  }
  body.cea-body .cea-main > .cea-summary-detail strong {
    font-size: clamp(28px, 8vw, 36px);
  }
  body.cea-body .cea-main > .cea-report-link {
    margin: 8px 0 10px;
  }
  body.cea-body .cea-main > .cea-report-link a {
    font-size: 12px;
    padding: 8px 11px;
    min-height: 36px;
  }
  body.cea-body .cea-main > .cea-tabs {
    margin: 11px 0 20px;
    padding: 4px;
    gap: 3px;
    border-radius: 17px;
  }
  body.cea-body .cea-main > .cea-tabs a {
    padding: 8px 3px;
    min-height: 43px;
    font-size: 12px;
    gap: 4px;
  }
  body.cea-body .cea-main > .cea-section {
    margin-top: 20px;
  }
  body.cea-body .cea-main > .cea-section > .cea-sectiontitle h2 {
    font-size: 19px;
  }
  body.cea-body .cea-main > .cea-section > .cea-membergrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  body.cea-body .cea-main .cea-membergrid > button.cea-membercard.cea-memberclick {
    min-height: 166px;
    padding: 12px 5px 11px;
    border-radius: 17px;
  }
  body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-avatar.cea-avatar-pictogram {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    margin-bottom: 8px;
  }
  body.cea-body .cea-main .cea-membergrid > .cea-membercard > strong {
    font-size: 13px !important;
    margin-bottom: 6px;
  }
  body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-parts {
    font-size: 11px;
    margin-bottom: 7px;
  }
  body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-total-amount {
    font-size: clamp(12px, 3.45vw, 16px);
  }
  body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-total-label {
    font-size: 10px;
  }
  body.cea-body .cea-main .cea-membergrid > .cea-membercard .cea-member-foot {
    display: none;
  }
  body.cea-body .cea-main > .cea-section > .cea-list > button.cea-expenseitem.cea-v3-expense-button {
    padding: 13px 12px;
    column-gap: 7px !important;
    min-height: 67px;
  }
  body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > span:nth-child(2) > strong {
    font-size: 13px;
  }
  body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > span:nth-child(2) > span {
    font-size: 11px;
  }
  body.cea-body .cea-main .cea-expenseitem.cea-v3-expense-button > b {
    font-size: 13px;
  }
  body.cea-body .cea-main > .cea-section > .cea-list > .cea-balancerow {
    min-height: 58px;
    padding: 13px 14px;
    gap: 8px;
  }
  body.cea-body .cea-main .cea-balancerow .cea-transfer-person { font-size: 13px; }
  body.cea-body .cea-main .cea-balancerow > b { font-size: 14px; }
}
@media (max-width: 350px) {
  body.cea-body .cea-main > .cea-section > .cea-membergrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.cea-body .cea-main > .cea-section > .cea-list > button.cea-expenseitem.cea-v3-expense-button {
    padding: 12px 9px;
    column-gap: 5px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.cea-body .cea-main .cea-membercard { transition: none; }
}
