/* Shared page headers: the organisation's solid primary and secondary trim. */
:root .entity-hero {
  --hero-ink: var(--wf-hero-ink, #fff);
  position: relative;
  isolation: isolate;
  background: var(--theme-color-principal, #233342) !important;
  color: var(--hero-ink) !important;
  border: 0 !important;
  border-top: 3px solid var(--theme-color-secondaire, #ffc107) !important;
  border-radius: 22px !important;
  padding: 20px !important;
  box-shadow: 0 8px 28px rgb(15 23 42 / 5%) !important;
  gap: 24px;
  min-width: 0;
}
:root .entity-hero::before, :root .entity-hero::after {
  content: none !important;
}
:root .entity-hero > .accent, :root .entity-hero > .hero-wave,
:root .entity-hero > .hero-orb-gold, :root .entity-hero > .hero-orb-line,
:root .entity-hero > .hero-glow-a, :root .entity-hero > .hero-glow-b,
:root .entity-hero > .hero-glow-c, :root .entity-hero > .course-hero__bg {
  display: none !important;
}
:root .entity-hero :is(h1, h2, .hero-title) {
  color: var(--hero-ink) !important;
  font-size: clamp(1.65rem, 2.5vw, 2.5rem) !important;
  font-weight: 750 !important;
  letter-spacing: -.035em;
  line-height: 1.18;
  text-shadow: none !important;
  overflow-wrap: anywhere;
}
:root .entity-hero :is(p, .hero-sub, .hero-subtitle, .hero-lead, .text-muted, .text-white-50) {
  color: color-mix(in srgb, var(--hero-ink) 80%, transparent) !important;
  line-height: 1.65;
  text-shadow: none !important;
}
/* Shared section badge, matching the dashboard's “Pilotage” label.
   The public homepage eyebrow is a container of multiple chips, not a badge. */
:root .entity-hero :is([class*="eyebrow"], [class*="kicker"], .entity-hero-label):not(:has(.label)) {
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
  width: fit-content;
  max-width: 100%;
  padding: .34rem .7rem !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--hero-ink) 11%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--hero-ink) 16%, transparent) !important;
  color: var(--wf-hero-accent, var(--theme-color-secondaire, #ffc107)) !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .14em !important;
  line-height: 1.6 !important;
  text-transform: uppercase;
  opacity: 1 !important;
  white-space: normal;
  margin-bottom: .75rem;
}
:root .entity-hero :is([class*="eyebrow"], [class*="kicker"], .entity-hero-label):not(:has(.label)) i {
  color: inherit !important;
  flex-shrink: 0;
}
:root .entity-hero :is(.hero-actions, .hero-ctas, .finance-hero__actions, .attendance-hero-actions) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
:root .entity-hero :is(.btn, .rp-button, .btn-hero, .pp-btn-hero) {
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 650;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: normal;
  text-decoration: none;
  box-shadow: none;
}
/* Preserve Bootstrap's success/danger/info actions; brand the neutral/main actions. */
:root .entity-hero :is(.btn-primary, .btn-warning, .btn-light, .btn-outline-light, .btn-outline-primary, .btn-outline-hero, .btn-hero, .pp-btn-hero, .rp-button.primary, .crm-primary) {
  background: var(--theme-color-secondaire, #ffc107) !important;
  border-color: var(--theme-color-secondaire, #ffc107) !important;
  color: var(--wf-accent-ink, #000) !important;
}
:root .entity-hero :is(.btn, .rp-button, .crm-primary, .hab-btn.gold, .mk-button, .wf-button, .ev-btn-primary, .pp-btn-hero):focus-visible {
  outline: 3px solid var(--hero-ink); outline-offset: 4px;
}
:root .entity-hero :is(.btn, .rp-button, .crm-primary, .hab-btn.gold, .mk-button, .wf-button, .ev-btn-primary, .pp-btn-hero):hover {
  filter: brightness(.94);
}
:root .entity-hero :is(.chip, .hero-pill, .hero-tag, .hero-badge) {
  background: color-mix(in srgb, var(--hero-ink) 8%, transparent) !important;
  border-color: color-mix(in srgb, var(--hero-ink) 22%, transparent) !important;
  color: var(--hero-ink) !important;
}
@media (max-width: 767.98px) {
  :root .entity-hero { flex-wrap: wrap; border-radius: 18px !important; }
  :root .entity-hero :is(.hero-actions, .hero-ctas) { width: 100%; }
}

:root .entity-hero :is(.text-white, .hero-meta, .eh-hero-foot, .of-hero__meta) {
  color: var(--hero-ink) !important;
}
:root .entity-hero :is(.hab-btn.gold, .mk-button, .wf-button, .ev-btn-primary) {
  background: var(--theme-color-secondaire, #ffc107) !important;
  border-color: var(--theme-color-secondaire, #ffc107) !important;
  color: var(--wf-accent-ink, #000) !important;
  border-radius: 12px;
}

/* Hero actions share the top-right alignment of the company directory. */
:root .entity-hero {
  align-items: flex-start !important;
}
:root .entity-hero :is(.btn, .rp-button, .hab-btn, .pp-btn, .crm-primary,
  .crm-button, .mk-button, .wf-button, .ev-btn, .ev-btn-primary, .iw-btn,
  .studio-btn, .cv-button, .btn-hero) {
  align-self: flex-start !important;
}
:root .entity-hero > :is(a, button):is(.btn, .rp-button, .hab-btn, .pp-btn,
  .crm-primary, .mk-button, .wf-button, .ev-btn, .iw-btn, .cv-button) {
  margin-left: auto;
  flex-shrink: 0;
}
:root .entity-hero :is(.hero-actions, .hero-ctas, .finance-hero__actions,
  .attendance-hero-actions, .cb-hero-actions, .curriculum-hero-actions,
  .pp-hero-main, .eh-hero-row, .ar-heading) {
  align-items: flex-start !important;
}
/* Existing Bootstrap wrappers can contain either the heading row or just actions. */
:root .entity-hero .d-flex:has(> :is(.btn, .btn-group, .dropdown)) {
  align-items: flex-start !important;
  align-self: flex-start !important;
  justify-content: flex-end !important;
  margin-left: auto;
}
:root .entity-hero :is(.hero-actions, .hero-ctas, .finance-hero__actions,
  .attendance-hero-actions, .cb-hero-actions, .curriculum-hero-actions) {
  margin-left: auto;
  justify-content: flex-end;
}
@media (max-width: 767.98px) {
  :root .entity-hero > :is(a, button),
  :root .entity-hero :is(.hero-actions, .hero-ctas, .finance-hero__actions,
    .attendance-hero-actions, .cb-hero-actions, .curriculum-hero-actions) {
    max-width: 100%;
    flex-wrap: wrap;
  }
}

/* Legacy heading wrapper: badge and title remain one item in flex headers. */
:root .entity-hero .entity-hero-heading { min-width: 0; flex: 1 1 auto; }
:root .entity-hero .entity-hero-heading > .entity-hero-label { display: flex !important; }

/* The learner questionnaire header is a full-width block, not a two-column hero. */
:root .entity-hero.qcm-list-hero { display: block !important; }
:root .entity-hero.qcm-list-hero > .w-100 { width: 100% !important; min-width: 0; }

/* Consistent large title pictogram, including editors that previously hid it. */
:root .entity-hero :is(h1, h2, .hero-title) .entity-hero-title-icon {
  display: inline-block !important;
  color: var(--wf-hero-accent, var(--theme-color-secondaire, #ffc107)) !important;
  font-size: .95em;
  line-height: 1;
  vertical-align: -.06em;
  margin-inline-end: .32em !important;
  flex-shrink: 0;
}
:root .entity-hero :is(h1, h2, .hero-title) :is(svg, img).entity-hero-title-icon {
  width: 1em;
  height: 1em;
  object-fit: contain;
}

/* Informational badges share the prospect form's compact rectangular shape.
   Keep section eyebrows and action buttons on their own styles. */
:root .entity-hero :is(.entity-hero-chip, .chip, .meta-chip, .hero-pill, .ev-chip,
  .of-hero__chip, .badge-soft, .soft-badge, .mk-badge, .rp-badge,
  .cx-dossier-badge, .ev-badge, .pill, .badge, .crm-org, span.doc-meta,
  :is(.entity-hero-meta, .pp-hero-footer, .sd-hero-footer, .se-hero-meta,
      .cv-hero-meta, .rp-hero-meta, .attendance-meta, .dossier-meta,
      .ifu-meta, .cc-chips, .ar-meta) > span):not(.btn):not([role="button"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px !important;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 31px;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  border: 1px solid color-mix(in srgb, var(--hero-ink) 25%, transparent) !important;
  background: color-mix(in srgb, var(--hero-ink) 8%, transparent) !important;
  color: var(--hero-ink) !important;
  font-size: .75rem !important;
  font-weight: 500 !important;
  line-height: 18px !important;
  letter-spacing: normal !important;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
  box-shadow: none;
}
:root .entity-hero :is(.entity-hero-chip, .chip, .meta-chip, .hero-pill, .ev-chip,
  .of-hero__chip, .badge-soft, .soft-badge, .mk-badge, .rp-badge,
  .cx-dossier-badge, .ev-badge, .pill, .badge, .crm-org, span.doc-meta,
  :is(.entity-hero-meta, .pp-hero-footer, .sd-hero-footer, .se-hero-meta,
      .cv-hero-meta, .rp-hero-meta, .attendance-meta, .dossier-meta,
      .ifu-meta, .cc-chips, .ar-meta) > span):not(.btn):not([role="button"]) > i {
  color: var(--wf-hero-accent, var(--theme-color-secondaire, #ffc107)) !important;
  font-size: 1em;
  margin: 0 !important;
  flex-shrink: 0;
}
:root .entity-hero :is(.entity-hero-meta, .pp-hero-footer, .sd-hero-footer,
  .se-hero-meta, .cv-hero-meta, .rp-hero-meta, .attendance-meta,
  .dossier-meta, .ifu-meta, .cc-chips, .ar-meta, .hero-pills, .of-hero__meta) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
:root .entity-hero :is(.pp-hero-footer, .sd-hero-footer) {
  border-top: 0;
  padding: 0;
}

/* Shared two-column hero, based on the satisfaction questionnaire editor. */
:root .entity-hero.entity-hero-arranged {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  align-items: start !important;
  text-align: left;
}
:root .entity-hero-arranged > .entity-hero-content {
  min-width: 0;
  width: 100%;
}
:root .entity-hero-arranged > .entity-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  max-width: 440px;
  min-width: 0;
  margin-left: auto;
}
:root .entity-hero .entity-hero-emblem {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--hero-ink) 24%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--hero-ink) 4%, transparent);
  color: var(--wf-hero-accent, var(--theme-color-secondaire, #ffc107));
  transform: rotate(-5deg);
  font-size: 28px;
}
:root .entity-hero .entity-hero-emblem :is(i, svg) {
  margin: 0 !important;
  color: inherit !important;
  font-size: 28px !important;
  width: 28px;
  height: 28px;
  line-height: 1;
}
:root .entity-hero .entity-hero-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
:root .entity-hero .entity-hero-action-group:not(a):not(button):not(input) {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px;
  width: auto;
  max-width: 100%;
  margin: 0 !important;
}
:root .entity-hero .entity-hero-controls :is(a, button, input):not(.dropdown-item):not([type="hidden"]) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px !important;
  height: auto !important;
  padding: 7px 14px !important;
  border-width: 1px !important;
  border-radius: 10px;
  font-size: .8125rem !important;
  line-height: 20px !important;
  font-weight: 600 !important;
  max-width: 100%;
  white-space: normal;
  margin-left: 0;
}
:root .entity-hero .entity-hero-side .se-hero-caption {
  max-width: 100%;
  text-align: right;
  font-size: 11px;
}
@media (max-width: 767.98px) {
  :root .entity-hero.entity-hero-arranged { grid-template-columns: minmax(0, 1fr); }
  :root .entity-hero-arranged > .entity-hero-side { width: 100%; max-width: 100%; }
  :root .entity-hero .entity-hero-emblem { width: 48px; height: 48px; border-radius: 12px; }
}
@media (pointer: coarse) {
  :root .entity-hero .entity-hero-controls :is(a, button, input):not(.dropdown-item):not([type="hidden"]) {
    min-height: 44px !important;
  }
}
/* Decorative legacy layers stay hidden after their content is wrapped. */
:root .entity-hero-content > :is(.accent, .hero-wave, .hero-orb-gold,
  .hero-orb-line, .hero-glow-a, .hero-glow-b, .hero-glow-c, .course-hero__bg) {
  display: none !important;
}

/* Phone headers: compact reading order, wrapping metadata and compact actions. */
@media (max-width: 767.98px) {
  :root .entity-hero {
    padding: 16px !important;
    gap: 16px !important;
    min-height: 0 !important;
    height: auto !important;
    max-width: 100%;
  }
  :root .entity-hero .entity-hero-emblem { display: none; }
  :root .entity-hero-arranged > .entity-hero-side {
    align-items: stretch;
    margin: 0;
    gap: 8px;
  }
  :root .entity-hero-side:not(:has(.entity-hero-controls > *)) { display: none; }
  :root .entity-hero .entity-hero-controls,
  :root .entity-hero .entity-hero-action-group:not(a):not(button):not(input) {
    display: flex;
    flex-direction: row !important;
    flex-wrap: wrap;
    width: auto;
    gap: 8px;
    justify-content: flex-start !important;
    align-items: center !important;
  }
  :root .entity-hero-controls > .entity-hero-action-group:not(a):not(button):not(input) {
    grid-column: 1 / -1;
  }
  :root .entity-hero .entity-hero-controls :is(a, button, input):not(.dropdown-item):not([type="hidden"]) {
    width: auto !important;
    flex: 0 1 auto;
    min-width: 0;
    min-height: 38px !important;
    height: auto !important;
    padding: 6px 10px !important;
    font-size: .75rem !important;
    align-self: stretch !important;
    overflow-wrap: anywhere;
  }
  :root .entity-hero .entity-hero-side .se-hero-caption { text-align: left; }
  :root .entity-hero :is(h1, h2, .hero-title) {
    font-size: clamp(1.4rem, 5.5vw, 1.75rem) !important;
    margin-bottom: 8px;
  }
  :root .entity-hero :is(p, .hero-sub, .hero-subtitle, .hero-lead) {
    font-size: .875rem;
    line-height: 1.5;
  }
  :root .entity-hero :is(.entity-hero-meta, .hero-pills, .of-hero__meta,
    .pp-hero-footer, .sd-hero-footer, .se-hero-meta, .cv-hero-meta,
    .rp-hero-meta, .attendance-meta, .dossier-meta, .ifu-meta, .cc-chips, .ar-meta) {
    margin-top: 12px !important;
    gap: 6px;
    min-width: 0;
  }
  :root .entity-hero :is([class*="eyebrow"], [class*="kicker"], .entity-hero-label):not(:has(.label)) {
    font-size: .65rem !important;
    letter-spacing: .08em !important;
  }
  /* Profile headers have an avatar instead of an h1 and are not rearranged by JS. */
  :root .entity-hero .stickyRow {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 0;
    gap: 12px;
    align-items: start;
  }
  :root .entity-hero .stickyRow > .flex-grow-1 { min-width: 0; }
  :root .entity-hero .stickyRow > .d-flex:has(> .btn) {
    grid-column: 1 / -1;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    width: 100%;
    margin: 0;
  }
  :root .entity-hero .stickyRow > .d-flex > .btn {
    width: auto !important;
    min-height: 38px !important;
    align-self: stretch !important;
  }
  :root .entity-hero .chip { min-width: 0; }
}
@media (max-width: 767.98px) {
  /* Nested grids must be allowed to shrink below their text's intrinsic width. */
  :root .entity-hero :is(.hero-grid, .hero-inner) {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  :root .entity-hero :is(.hero-grid, .hero-inner) > * { min-width: 0; }
  :root .entity-hero :is(.hero-shell, .w-max) { padding-inline: 0; width: 100%; }
  :root .entity-hero :is(.hero-card, .live-card) { max-width: 100%; overflow-wrap: anywhere; }
  :root .entity-hero .kpi { flex-wrap: wrap; min-width: 0; }
  :root .entity-hero .d-grid { min-width: 0; }
  :root .entity-hero.qcm-hero .d-flex { flex-wrap: wrap; min-width: 0; }
  :root .entity-hero.qcm-hero :is(.title, .subtitle, .status-pill) {
    max-width: 100%; white-space: normal; overflow-wrap: anywhere;
  }
}
@media (max-width: 767.98px) {
  html.workspace-shell .entity-hero { --workspace-button-height: 38px; --workspace-button-padding-x: 10px; --workspace-button-padding-y: 6px; --workspace-button-font-size: .75rem; }
}
@media (max-width: 767.98px) {
  /* Keep profile contact details full-width below the avatar and name. */
  :root .entity-hero .stickyRow > .flex-grow-1 { display: contents; }
  :root .entity-hero .stickyRow > .avatar { grid-column: 1; grid-row: 1 / span 2; }
  :root .entity-hero .stickyRow > .flex-grow-1 > :not(.d-flex) {
    grid-column: 2;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  :root .entity-hero .stickyRow > .flex-grow-1 > .d-flex {
    grid-column: 1 / -1;
    min-width: 0;
    margin-top: 0 !important;
  }
}
