/* Regression fixes for the V105 scroll-story integration. Keep every rule
   scoped to its existing project so the approved visual identity is intact. */

/* The Cetelem host still includes a legacy V93 iframe visibility guard.
   The embedded V47 scene exposes its own ready class instead. */
#interface-en-contexte .c103-lab.c103-loaded #c103-original-scene {
  visibility: visible !important;
}

/* Restore the source-based first Malakoff frame, whose V80/V86 styles were
   omitted from the slim V105 release stylesheet. */
#malakoff-experience.mh9 .mh80-problem {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  background: #fff;
  color: #172e45;
  font-family: 'MH Poppins', system-ui, sans-serif;
  pointer-events: none;
}
#malakoff-experience.mh9 .mh80-problem-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
#malakoff-experience.mh9 .mh80-problem-head strong { font-size: 17px; line-height: 1.3; }
#malakoff-experience.mh9 .mh80-problem-head > span { color: #63757c; font-size: 10px; white-space: nowrap; }
#malakoff-experience.mh9 .mh86-accesses {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  flex: 1;
  min-height: 0;
  margin-top: 15px;
}
#malakoff-experience.mh9 .mh86-accesses > div {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid #e5e9eb;
}
#malakoff-experience.mh9 .mh86-accesses > div:last-child { border-bottom: 0; }
#malakoff-experience.mh9 .mh86-access-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: #f0f3f4;
  color: #536b79;
  font-size: 17px;
  font-weight: 600;
}
#malakoff-experience.mh9 .mh86-accesses strong {
  display: block;
  color: #172e45;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
#malakoff-experience.mh9 .mh86-accesses small {
  display: block;
  margin-top: 3px;
  color: #536575;
  font-size: 11px;
  line-height: 1.4;
}
#malakoff-experience.mh9 .mh80-problem > p {
  margin: 10px 0 0;
  padding-left: 10px;
  border-left: 2px solid #dc795d;
  color: #934330;
  font-size: 12px;
  line-height: 1.45;
}

/* Keep the foreground reimbursement card grounded and the closing actions
   compact, legible, and separated from the transcript. */
#malakoff-experience.mh9 .mh9-card {
  box-shadow: 0 10px 28px rgba(11, 30, 53, .12) !important;
}
#malakoff-experience.mh9 .mh-after {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px 28px;
}
#malakoff-experience.mh9 .mh-after .mh3-transcript { grid-column: 1 / -1; }
#malakoff-experience.mh9 .mh-after > a:not(.sober-case-link) {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  color: #e1e9f1;
  text-decoration: underline;
  text-decoration-color: #8294a9;
  text-underline-offset: 4px;
}
#malakoff-experience.mh9 .mh-after > a.sober-case-link {
  grid-column: 2;
  justify-self: end;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  white-space: nowrap;
}

/* Restore the reserved, fixed-height controls from the original home-story
   integration. Without this row, the live progress label can shrink to a
   single character per line and cover the mobile illustration. */
.home-page #malakoff-experience .mh3-stage {
  min-height: 0;
  grid-template-rows: 42px minmax(0, 1fr) 68px 0;
  padding-bottom: 0;
}
.home-page #malakoff-experience .mh3-main { grid-row: 2; }
.home-page #malakoff-experience .mh3-chapters { display: none; }
.home-page.story-controls-active .sober-to-top {
  top: calc(var(--gn88-site-header, 76px) + 10px);
  bottom: auto;
}
.home-page #malakoff-experience .gn94-controls,
.home-page #allianz-trade-pay .gn94-controls {
  height: 68px;
  min-height: 68px;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(18px, 5vw, 40px) 6px;
  background: inherit;
}
.home-page #malakoff-experience .gn94-controls .gn93-progress,
.home-page #allianz-trade-pay .gn94-controls .gn93-progress {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 40%;
  margin: 0 auto 0 0;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
}
.home-page #malakoff-experience .gn94-controls .gn93-progress,
.home-page #allianz-trade-pay .gn94-controls .gn93-progress { max-width: none; }
.home-page #malakoff-experience .gn94-meter,
.home-page #allianz-trade-pay .gn94-meter {
  position: absolute;
  top: 0;
  left: clamp(18px, 5vw, 40px);
  right: clamp(18px, 5vw, 40px);
  width: auto;
  height: 3px;
}
.home-page #malakoff-experience .gn94-controls .gn94-skip,
.home-page #allianz-trade-pay .gn94-controls .gn94-skip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 7px;
  min-height: 44px;
  padding: 0 5px;
  white-space: nowrap;
}
.home-page #malakoff-experience .gn94-controls .mh3-controls,
.home-page #allianz-trade-pay .gn94-controls .gn93-buttons {
  display: flex;
  align-items: center;
  flex: none;
  gap: 7px;
  margin-left: 0;
}
.home-page #malakoff-experience .gn94-controls .mh3-controls button,
.home-page #allianz-trade-pay .gn94-controls .gn93-buttons button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 50%;
}

@media (max-width: 600px) {
  #malakoff-experience.mh9 .mh80-problem { padding: 16px; }
  #malakoff-experience.mh9 .mh80-problem-head strong { font-size: 14px; }
  #malakoff-experience.mh9 .mh80-problem-head > span { display: none; }
  #malakoff-experience.mh9 .mh86-accesses { margin-top: 12px; }
  #malakoff-experience.mh9 .mh86-accesses > div { gap: 11px; padding: 8px 0; }
  #malakoff-experience.mh9 .mh86-accesses small { font-size: 10px; }
  #malakoff-experience.mh9 .mh80-problem > p { font-size: 10px; }
  #malakoff-experience.mh9 .mh-after { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; gap: 10px; }
  #malakoff-experience.mh9 .mh-after .mh3-transcript,
  #malakoff-experience.mh9 .mh-after > a:not(.sober-case-link),
  #malakoff-experience.mh9 .mh-after > a.sober-case-link { grid-column: 1; }
  #malakoff-experience.mh9 .mh-after > a.sober-case-link { justify-self: start; white-space: normal; }
  .home-page #malakoff-experience .mh3-stage { padding: 18px 16px 0; grid-template-rows: 24px minmax(0, 1fr) 68px 0; }
  .home-page #malakoff-experience .mh3-main { grid-row: 2; }
  .home-page #malakoff-experience .mh3-skip { display: none; }
  .home-page #malakoff-experience .gn94-controls,
  .home-page #allianz-trade-pay .gn94-controls { gap: 8px; padding: 8px 16px 5px; }
  .home-page #malakoff-experience .gn94-controls .gn93-progress,
  .home-page #allianz-trade-pay .gn94-controls .gn93-progress { max-width: 36%; font-size: 10px; }
  .home-page #malakoff-experience .gn94-controls .gn93-buttons button,
  .home-page #allianz-trade-pay .gn94-controls .gn93-buttons button,
  .home-page #malakoff-experience .gn94-controls .mh3-controls button { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  #malakoff-experience.mh9 .mh9-card { box-shadow: 0 8px 22px rgba(11, 30, 53, .1) !important; }
}
