/* ============================================================================
   MacroEcoMatch — interface V10
   Styles volontairement scopés sous .macroeco-shell pour éviter les conflits
   avec le thème général du site.
   ============================================================================ */

.macroeco-shell {
  --mem-ink: #172033;
  --mem-muted: #667085;
  --mem-border: #e4e7ec;
  --mem-soft: #f8fafc;
  --mem-card: #ffffff;
  --mem-keynes: #b42318;
  --mem-keynes-soft: #fff1f0;
  --mem-neo: #175cd3;
  --mem-neo-soft: #eff8ff;
  --mem-accent: #6941c6;
  --mem-accent-soft: #f4f0ff;
  --mem-up: #067647;
  --mem-up-soft: #ecfdf3;
  --mem-down: #b42318;
  --mem-down-soft: #fff1f0;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
  color: var(--mem-ink);
}

.macroeco-shell .hero-match {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f8f5ff 54%, #f0f7ff 100%);
  border: 1px solid var(--mem-border);
  border-radius: 26px;
  padding: clamp(1.4rem, 3vw, 2.8rem);
  box-shadow: 0 18px 55px rgba(16, 24, 40, .08);
}

.macroeco-shell .hero-match::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: -90px;
  top: -100px;
  background: radial-gradient(circle, rgba(105, 65, 198, .16), rgba(105, 65, 198, 0) 70%);
  pointer-events: none;
}

.macroeco-shell .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .34rem .7rem;
  border-radius: 999px;
  background: rgba(105, 65, 198, .09);
  color: #53389e;
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.macroeco-shell .hero-match h1 {
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  margin: .85rem 0 .8rem;
}

.macroeco-shell .hero-sub {
  max-width: 880px;
  margin: 0 auto;
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  color: #344054;
}

.macroeco-shell .hero-figures {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 1.2rem;
}

.macroeco-shell .hero-figures img {
  height: 105px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(16, 24, 40, .14));
}

.macroeco-shell .kb-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
}

.macroeco-shell .kb-stats span {
  padding: .42rem .7rem;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(208, 213, 221, .9);
  border-radius: 999px;
  color: #475467;
  font-size: .88rem;
  backdrop-filter: blur(6px);
}

.macroeco-shell .section-card {
  margin-top: 1.25rem;
  background: var(--mem-card);
  border: 1px solid var(--mem-border);
  border-radius: 22px;
  padding: clamp(1rem, 2.4vw, 1.7rem);
  box-shadow: 0 8px 30px rgba(16, 24, 40, .045);
}

.macroeco-shell .section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.macroeco-shell .section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  letter-spacing: -.02em;
}

.macroeco-shell .section-heading p {
  margin: .25rem 0 0;
  color: var(--mem-muted);
}

.macroeco-shell .theme-filters {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .1rem .05rem .6rem;
  scrollbar-width: thin;
}

.macroeco-shell .theme-chip {
  white-space: nowrap;
  border: 1px solid var(--mem-border);
  background: #fff;
  color: #475467;
  border-radius: 999px;
  padding: .46rem .75rem;
  font-size: .88rem;
  font-weight: 650;
  transition: .18s ease;
}

.macroeco-shell .theme-chip:hover,
.macroeco-shell .theme-chip:focus-visible {
  border-color: #b9a7ee;
  color: #53389e;
  outline: none;
}

.macroeco-shell .theme-chip.active {
  color: #fff;
  border-color: var(--mem-accent);
  background: var(--mem-accent);
}

.macroeco-shell .scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}

.macroeco-shell .scenario-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  text-align: left;
  padding: 1rem;
  border: 1px solid var(--mem-border);
  border-radius: 18px;
  background: #fff;
  color: inherit;
  box-shadow: 0 2px 9px rgba(16, 24, 40, .025);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.macroeco-shell .scenario-card:hover,
.macroeco-shell .scenario-card:focus-visible {
  transform: translateY(-2px);
  border-color: #b9a7ee;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .08);
  outline: none;
}

.macroeco-shell .scenario-top {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  align-items: center;
  margin-bottom: .8rem;
}

.macroeco-shell .scenario-badge,
.macroeco-shell .scenario-level {
  display: inline-flex;
  padding: .27rem .48rem;
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 750;
}

.macroeco-shell .scenario-badge {
  background: var(--mem-accent-soft);
  color: #53389e;
}

.macroeco-shell .scenario-level {
  background: #f2f4f7;
  color: #475467;
}

.macroeco-shell .scenario-title {
  font-weight: 760;
  line-height: 1.28;
  color: #1d2939;
}

.macroeco-shell .scenario-help {
  color: var(--mem-muted);
  font-size: .86rem;
  line-height: 1.42;
  margin-top: .55rem;
}

.macroeco-shell .scenario-go {
  margin-top: auto;
  padding-top: .8rem;
  color: #53389e;
  font-size: .86rem;
  font-weight: 760;
}

.macroeco-shell .sandbox-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .8rem;
}

/* Sélecteurs de concepts recherchables — V10.3 */
.macroeco-shell .concept-picker {
  position: relative;
  overflow: visible;
}

.macroeco-shell .picker-input-wrap {
  position: relative;
}

.macroeco-shell .concept-search-input {
  padding-right: 2.25rem;
  background: #fff;
}

.macroeco-shell .concept-picker.is-selected .concept-search-input {
  border-color: #75b798;
  box-shadow: 0 0 0 .16rem rgba(25, 135, 84, .10);
}

.macroeco-shell .picker-clear {
  position: absolute;
  right: .45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.65rem;
  height: 1.65rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #667085;
  font-size: 1.15rem;
  line-height: 1;
}

.macroeco-shell .picker-clear:hover,
.macroeco-shell .picker-clear:focus-visible {
  background: #eef2f6;
  color: #101828;
  outline: none;
}

.macroeco-shell .concept-suggestions {
  position: absolute;
  z-index: 1050;
  left: 0;
  right: 0;
  top: calc(100% + .35rem);
  max-height: 320px;
  overflow-y: auto;
  padding: .35rem;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .14);
}

.macroeco-shell .concept-suggestion {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: .12rem;
  padding: .58rem .65rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  color: #101828;
}

.macroeco-shell .concept-suggestion:hover,
.macroeco-shell .concept-suggestion:focus-visible {
  background: #f4f3ff;
  outline: none;
}

.macroeco-shell .concept-suggestion-name {
  font-size: .9rem;
  font-weight: 720;
}

.macroeco-shell .concept-suggestion-meta {
  color: #667085;
  font-size: .72rem;
}

.macroeco-shell .concept-no-result {
  padding: .7rem;
  color: #667085;
  font-size: .82rem;
}

.macroeco-shell .option-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: .75rem;
  margin-top: .8rem;
}

.macroeco-shell .tool-box {
  border: 1px solid var(--mem-border);
  border-radius: 14px;
  padding: .8rem;
  background: var(--mem-soft);
}

.macroeco-shell .tool-box label,
.macroeco-shell .tool-box .tool-label {
  display: block;
  margin-bottom: .4rem;
  font-size: .82rem;
  font-weight: 760;
  color: #344054;
}

.macroeco-shell .micro-help {
  color: var(--mem-muted);
  font-size: .78rem;
  line-height: 1.35;
  margin-top: .35rem;
}

.macroeco-shell .range-wrap {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.macroeco-shell #max-nodes-value {
  min-width: 2rem;
  text-align: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--mem-border);
  padding: .25rem .35rem;
  font-weight: 800;
}

.macroeco-shell .variation-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.macroeco-shell .variation-picker .form-check {
  margin: 0;
  padding: .48rem .65rem .48rem 2rem;
  border: 1px solid var(--mem-border);
  background: #fff;
  border-radius: 10px;
}

.macroeco-shell .launch-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.macroeco-shell .legend-line {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  color: var(--mem-muted);
  font-size: .82rem;
}

.macroeco-shell .legend-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  font-weight: 850;
}

.macroeco-shell .legend-dot.up {
  background: var(--mem-up-soft);
  color: var(--mem-up);
}

.macroeco-shell .legend-dot.down {
  background: var(--mem-down-soft);
  color: var(--mem-down);
}

.macroeco-shell .model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.macroeco-shell .model-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--mem-border);
  border-radius: 20px;
  min-width: 0;
}

.macroeco-shell .model-card.keynes {
  box-shadow: inset 0 4px 0 var(--mem-keynes);
}

.macroeco-shell .model-card.neo {
  box-shadow: inset 0 4px 0 var(--mem-neo);
}

.macroeco-shell .model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--mem-border);
}

.macroeco-shell .model-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 820;
}

.macroeco-shell .model-sub {
  color: var(--mem-muted);
  font-size: .8rem;
  margin-top: .18rem;
}

.macroeco-shell .model-pill {
  padding: .33rem .52rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 760;
  white-space: nowrap;
}

.macroeco-shell .keynes .model-pill {
  background: var(--mem-keynes-soft);
  color: var(--mem-keynes);
}

.macroeco-shell .neo .model-pill {
  background: var(--mem-neo-soft);
  color: var(--mem-neo);
}

.macroeco-shell .model-body {
  padding: 1rem;
}

.macroeco-shell .path-container {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: .4rem;
  min-height: 62px;
  padding: .65rem;
  background: var(--mem-soft);
  border: 1px solid #eef0f3;
  border-radius: 14px;
}

.macroeco-shell .path-node {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  text-align: left;
  padding: .48rem .56rem;
  border: 1px solid #d0d5dd;
  border-radius: 11px;
  background: #fff;
  color: #1d2939;
  font-size: .84rem;
  font-weight: 660;
  line-height: 1.22;
}

.macroeco-shell .path-node:hover,
.macroeco-shell .path-node:focus-visible {
  border-color: #98a2b3;
  box-shadow: 0 0 0 3px rgba(105, 65, 198, .08);
  outline: none;
}

.macroeco-shell .direction {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  font-weight: 900;
}

.macroeco-shell .direction.up {
  color: var(--mem-up);
  background: var(--mem-up-soft);
}

.macroeco-shell .direction.down {
  color: var(--mem-down);
  background: var(--mem-down-soft);
}

.macroeco-shell .path-arrow {
  align-self: center;
  border: 0;
  background: transparent;
  color: #7f56d9;
  font-size: 1.25rem;
  font-weight: 900;
  padding: .3rem .15rem;
  border-radius: 8px;
}

.macroeco-shell .path-arrow:hover,
.macroeco-shell .path-arrow:focus-visible {
  background: var(--mem-accent-soft);
  outline: none;
}

.macroeco-shell .relation-inspector,
.macroeco-shell .concept-inspector-global {
  min-height: 76px;
  margin-top: .75rem;
  padding: .78rem .85rem;
  border-radius: 14px;
  border: 1px dashed #c7b9ed;
  background: #fbfaff;
  color: #344054;
  font-size: .84rem;
}

.macroeco-shell .relation-inspector:empty::before {
  content: "Cliquez sur une flèche pour expliquer le mécanisme.";
  color: #98a2b3;
}

.macroeco-shell .relation-head {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

.macroeco-shell .relation-sign,
.macroeco-shell .relation-status,
.macroeco-shell .meta-row span {
  display: inline-flex;
  padding: .25rem .45rem;
  border-radius: 7px;
  background: #f2f4f7;
  color: #475467;
  font-size: .75rem;
  font-weight: 720;
}

.macroeco-shell .relation-status {
  background: var(--mem-accent-soft);
  color: #53389e;
}

.macroeco-shell .relation-meta {
  display: grid;
  gap: .3rem;
  color: #475467;
}

.macroeco-shell .expert-meta {
  margin-top: .35rem;
  color: #6941c6;
  font-size: .78rem;
}

.macroeco-shell .concept-inspector-global {
  margin: 1rem 0 0;
  background: #fff;
  border-style: solid;
  border-color: var(--mem-border);
}

.macroeco-shell .concept-inspector-global:empty {
  display: none;
}

.macroeco-shell .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.macroeco-shell .model-limit {
  color: var(--mem-muted);
  font-size: .82rem;
  border-left: 3px solid #d0d5dd;
  padding-left: .7rem;
}

.macroeco-shell .empty-path {
  padding: .65rem .75rem;
  color: #9a3412;
  background: #fff7ed;
  border-radius: 10px;
}

.macroeco-shell .reveal-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.macroeco-shell .reveal-btn {
  display: none;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1rem;
  border-radius: 11px;
  border: 1px solid #7f56d9;
  background: #fff;
  color: #53389e;
  font-weight: 770;
}

.macroeco-shell .reveal-btn:hover,
.macroeco-shell .reveal-btn:focus-visible {
  background: var(--mem-accent-soft);
  outline: none;
}

.macroeco-shell .analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.macroeco-shell .analysis-card {
  border: 1px solid var(--mem-border);
  background: #fff;
  border-radius: 15px;
  padding: .9rem;
}

.macroeco-shell .analysis-card h4 {
  font-size: 1rem;
  margin: .3rem 0 .5rem;
}

.macroeco-shell .analysis-card p {
  margin: 0;
  color: #475467;
  font-size: .87rem;
}

.macroeco-shell .analysis-kicker {
  display: inline-flex;
  color: #6941c6;
  font-size: .74rem;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.macroeco-shell .analysis-task {
  background: #f9f5ff;
  border-color: #d9d0f2;
}

.macroeco-shell .question-recap {
  border-radius: 14px;
  border: 1px solid #b2ddff;
  background: #eff8ff;
  color: #1849a9;
}

@media (max-width: 1100px) {
  .macroeco-shell .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .macroeco-shell .sandbox-tools { grid-template-columns: 1fr 1fr; }
  .macroeco-shell .analysis-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .macroeco-shell { padding-left: .65rem; padding-right: .65rem; }
  .macroeco-shell .scenario-grid,
  .macroeco-shell .model-grid,
  .macroeco-shell .analysis-grid,
  .macroeco-shell .sandbox-tools,
  .macroeco-shell .option-strip { grid-template-columns: 1fr; }
  .macroeco-shell .hero-figures img { height: 82px; }
  .macroeco-shell .launch-row { flex-direction: column; align-items: stretch; }
  .macroeco-shell .launch-row .btn { width: 100%; }
}


/* Diagnostic de chargement V10.2 */
.macroeco-shell .macroeco-diagnostic {
  display: none;
  margin: .15rem 0 .75rem;
  padding: .65rem .8rem;
  border-radius: 12px;
  font-size: .86rem;
  line-height: 1.4;
}
.macroeco-shell .macroeco-diagnostic.warning {
  display: block;
  background: #fffaeb;
  border: 1px solid #fedf89;
  color: #7a2e0e;
}
.macroeco-shell .macroeco-diagnostic.ok {
  display: block;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #05603a;
}


/* ==========================================================================
   Correctifs interactifs V10.4
   ========================================================================== */

.macroeco-shell .depth-control {
  display: grid;
  grid-template-columns: 2.25rem minmax(150px, 1fr) 2.6rem 2.25rem;
  align-items: center;
  gap: .55rem;
}

.macroeco-shell .depth-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: #344054;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}

.macroeco-shell .depth-step:hover,
.macroeco-shell .depth-step:focus-visible {
  border-color: #9e77ed;
  background: #f4f0ff;
  color: #53389e;
  outline: none;
}

.macroeco-shell .depth-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  height: 2.25rem;
  padding: 0 .55rem;
  border-radius: 10px;
  background: #101828;
  color: #fff;
  font-weight: 800;
}

.macroeco-shell .path-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  min-width: 2.8rem;
  min-height: 2.55rem;
  padding: .36rem .48rem;
  border: 1px solid #d6bbfb;
  background: #faf7ff;
  color: #6941c6;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
}

.macroeco-shell .path-arrow-symbol {
  font-size: 1.25rem;
  line-height: 1;
}

.macroeco-shell .path-arrow-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #6941c6;
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
}

.macroeco-shell .path-arrow:hover,
.macroeco-shell .path-arrow:focus-visible,
.macroeco-shell .path-arrow.is-active {
  border-color: #7f56d9;
  background: #f0eaff;
  box-shadow: 0 0 0 3px rgba(105,65,198,.10);
}

.macroeco-shell .concept-suggestions:not([hidden]) {
  display: block;
}

@media (max-width: 640px) {
  .macroeco-shell .depth-control {
    grid-template-columns: 2.25rem minmax(100px, 1fr) 2.6rem 2.25rem;
  }
}
