/* MBF V5 — finitions profil complet + cycle dynamique + calendriers sélectionnables */
#mbfProfileV4Backdrop.mbfv5-profile-ready,
#mbfProfileV4Backdrop{
  align-items:flex-start!important;
  justify-content:center!important;
  overflow-y:auto!important;
  padding:18px 18px max(18px, env(safe-area-inset-bottom,18px))!important;
}
#mbfProfileV4Modal.mbfv5-profile-ready,
#mbfProfileV4Modal{
  width:min(1120px, calc(100vw - 32px))!important;
  max-height:calc(100dvh - 36px)!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  margin:auto 0!important;
}
.mbfv4-profile-body{
  grid-template-columns:minmax(360px,.95fr) minmax(390px,1.05fr)!important;
  align-items:start!important;
}
.mbfv4-modules{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:9px!important;
}
.mbfv4-module-row{min-height:54px!important;padding:9px 10px!important;}
.mbfv4-module-row .label{min-width:0!important;}
.mbfv4-module-row .label small{white-space:normal!important;line-height:1.2!important;}
.mbfv4-save-item{min-height:58px!important;}
.mbfv4-profile-head{position:sticky!important;top:0!important;z-index:2!important;}
@media(max-width:1040px){.mbfv4-modules{grid-template-columns:1fr!important}.mbfv4-profile-body{grid-template-columns:1fr!important}}
@media(max-width:720px){#mbfProfileV4Backdrop{padding:8px!important}#mbfProfileV4Modal{width:calc(100vw - 12px)!important;max-height:calc(100dvh - 16px)!important;border-radius:22px!important}.mbfv4-actions{grid-template-columns:1fr!important}.mbfv4-profile-body{padding:14px!important}.mbfv4-grid2{grid-template-columns:1fr!important}}

/* Cycle V5 */
.mbfv5-cycle .mbfv4-cycle-card{overflow:hidden;}
.mbfv5-cycle-left{min-width:0;}
.mbfv5-cal-help,.mbfv5-form-note{
  border:1px solid rgba(217,27,128,.14);
  background:linear-gradient(135deg,#fff7fc,#f8ecff);
  color:#6f5269;
  border-radius:16px;
  padding:9px 11px;
  font-size:12px;
  line-height:1.35;
  margin-bottom:12px;
  font-weight:700;
}
.mbfv5-cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;text-align:center;touch-action:none;user-select:none;}
.mbfv5-day{min-height:46px;border-radius:16px;border:1px solid rgba(190,91,151,.18);background:#fff;color:#2e1730;font-weight:900;cursor:pointer;position:relative;transition:transform .12s, box-shadow .12s, background .12s;}
.mbfv5-day:not(.empty):hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(176,27,141,.12);}
.mbfv5-day.empty{opacity:0;pointer-events:none;}
.mbfv5-day.rules{background:#ffd7e9;color:#8f174f;border-color:#ffc0dd;}
.mbfv5-day.fertile{background:#ffe8d2;color:#7c3b00;border-color:#ffd2a5;}
.mbfv5-day.ovulation{background:#ffd28e;color:#6b3200;border-color:#ffbd68;}
.mbfv5-day.next{background:#eee2ff;color:#6b2eb5;border-style:dashed;}
.mbfv5-day.today{box-shadow:inset 0 0 0 2px rgba(176,27,141,.24);}
.mbfv5-day.sel{background:linear-gradient(135deg,#b01b8d,#e13692)!important;color:#fff!important;border-color:transparent!important;}
.mbfv5-day.in-range,.mini-cal-day.in-range{background:linear-gradient(135deg,#f9a8d4,#d946ef)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 8px 20px rgba(217,27,128,.22)!important;}
.mbfv5-day.range-start,.mini-cal-day.range-start{border-radius:18px 8px 8px 18px!important;}
.mbfv5-day.range-end,.mini-cal-day.range-end{border-radius:8px 18px 18px 8px!important;}
.mbfv5-range-dot{width:10px;height:10px;border-radius:50%;display:inline-block;background:linear-gradient(135deg,#f9a8d4,#d946ef)}
.mbfv5-current{border:1px solid rgba(190,91,151,.18);border-radius:18px;background:#fff;padding:13px;margin-top:15px;}
.mbfv5-action-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;}
.mbfv5-action-grid .primary{grid-column:1/-1;}
.mbfv5-kpis{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.mbfv4-kpi em{display:block;font-style:normal;color:#6f5269;font-size:11px;margin-top:3px;font-weight:700;line-height:1.25;}
.mbfv4-kpi strong{font-size:17px!important;line-height:1.15!important;word-break:normal;}
@media(max-width:1100px){.mbfv5-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}.mbfv5-action-grid{grid-template-columns:1fr!important}.mbfv5-action-grid .primary{grid-column:auto}}
@media(max-width:720px){.mbfv5-cal-grid{gap:5px}.mbfv5-day{min-height:44px;border-radius:14px}.mbfv5-kpis{grid-template-columns:1fr!important}}

/* Mini calendrier RDV : phases cycle + glisser */
#miniCalendarWrapper{overflow:visible!important;}
.mini-cal-header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;}
.mbf-cal-nav{width:34px!important;height:34px!important;border-radius:12px!important;border:1px solid rgba(217,27,128,.22)!important;background:#fff!important;color:#d91b80!important;font-weight:900!important;display:grid!important;place-items:center!important;cursor:pointer!important;}
#miniCalMonthLabel{text-transform:capitalize!important;color:#2e1730!important;font-weight:900!important;}
#miniCalGrid{touch-action:none;user-select:none;}
.mini-cal-day.mbfv5-mini-day{position:relative!important;min-height:32px!important;border-radius:10px!important;font-weight:800!important;color:#2e1730!important;border:1px solid rgba(190,91,151,.13)!important;background:#fff!important;}
.mini-cal-day.phase-rules{background:#ffd7e9!important;color:#8f174f!important;}
.mini-cal-day.phase-fertile{background:#ffe8d2!important;color:#7c3b00!important;}
.mini-cal-day.phase-ovulation{background:#ffd28e!important;color:#6b3200!important;}
.mini-cal-day.phase-next{background:#eee2ff!important;color:#6b2eb5!important;border-style:dashed!important;}
.mini-cal-day.has-appt::after{content:'';position:absolute;bottom:3px;left:50%;width:5px;height:5px;transform:translateX(-50%);border-radius:50%;background:#d91b80;}
.mini-cal-legend{opacity:1!important;color:#6f5269!important;line-height:1.3!important;}
.mini-cal-legend i{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px;vertical-align:middle;}
.mini-cal-legend .p{background:#ffd7e9}.mini-cal-legend .f{background:#ffe8d2}.mini-cal-legend .o{background:#ffd28e}.mini-cal-legend .n{background:#eee2ff;border:1px dashed #9c13b8}
