.site-main--ml-atlas {
  /* Keep the shared non-home background visible, as on the Series page. */
  background: transparent;
  color: #fdf0d5;
  min-height: 100vh;
  padding: 2rem 2.5rem 3rem;
}

.ml-atlas-intro {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
}

.ml-atlas-intro__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: #669bbc;
}

.ml-atlas-intro__title {
  margin: 0.35rem 0 0.55rem;
  font-family: "Montserrat", var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: clamp(1.3rem, 2vw, 2rem);
}

.ml-atlas-intro__description {
  margin: 0;
  max-width: 70ch;
  color: rgba(253, 240, 213, 0.84);
}

.ml-superfamily-legend {
  margin-top: 0.85rem;
  border-top: 1px solid rgba(253, 240, 213, 0.2);
  padding-top: 0.7rem;
}

.ml-superfamily-legend__title {
  margin: 0 0 0.55rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(253, 240, 213, 0.86);
  font-family: "Montserrat", var(--font-body);
}

.ml-superfamily-legend__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.9rem;
}

.ml-superfamily-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.ml-superfamily-legend__label {
  font-size: 0.7rem;
  color: rgba(253, 240, 213, 0.84);
  font-family: "Montserrat", var(--font-body);
}

.ml-superfamily-legend__shape {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.ml-superfamily-legend__shape-svg {
  width: 18px;
  height: 18px;
  display: block;
  filter: drop-shadow(0 0 2px rgba(102, 155, 188, 0.22));
}

.ml-superfamily-legend__shape--circle {
  border-radius: 999px;
}

.ml-superfamily-legend__shape--triangle {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.ml-superfamily-legend__shape--square {
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

.ml-superfamily-legend__shape--pentagon {
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.ml-superfamily-legend__shape--diamond {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.ml-superfamily-legend__shape--triangle_inverted {
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.ml-superfamily-legend__shape--hexagon {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.ml-superfamily-legend__shape--heptagon {
  clip-path: polygon(50% 0%, 83% 8%, 100% 35%, 93% 68%, 68% 95%, 32% 95%, 7% 68%, 0% 35%, 17% 8%);
}

.ml-superfamily-legend__shape--octagon {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.ml-superfamily-legend__shape--decagon {
  clip-path: polygon(50% 0%, 79% 10%, 96% 35%, 96% 65%, 79% 90%, 50% 100%, 21% 90%, 4% 65%, 4% 35%, 21% 10%);
}

.ml-map-shell {
  max-width: 1400px;
  margin: 0 auto;
}

.ml-map-app__loading {
  margin: 0;
  padding: 1.1rem;
  color: rgba(253, 240, 213, 0.84);
}

.ml-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(230px, 0.62fr);
  gap: 1.25rem;
  align-items: start;
  transition: grid-template-columns 260ms ease;
  min-width: 0;
}

.ml-map-layout__tree {
  border: 0;
  background: transparent;
  min-height: 760px;
  overflow: auto;
  min-width: 0;
}

.ml-map-svg-root {
  min-height: 760px;
  width: 100%;
}

.ml-tree-svg {
  width: auto;
  height: auto;
  min-height: 760px;
  display: block;
}

.ml-map-layout__panel {
  position: sticky;
  top: 1rem;
  align-self: start;
  border: 1px solid rgba(253, 240, 213, 0.25);
  background: rgba(5, 13, 20, 0.94);
  min-height: 100%;
  overflow: hidden;
}

.ml-panel-content {
  padding: 1rem;
}

.ml-panel__header h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fdf0d5;
  font-family: "Montserrat", var(--font-body);
  font-weight: 600;
}

.ml-panel__header p {
  margin: 0.35rem 0 1rem;
  color: rgba(253, 240, 213, 0.75);
  font-size: 0.88rem;
}

.ml-panel__reset-btn {
  border: 1px solid rgba(253, 240, 213, 0.35);
  background: transparent;
  color: #fdf0d5;
  font-family: "Montserrat", var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.34rem 0.56rem;
  margin-bottom: 0.72rem;
  transition: border-color 220ms ease, color 220ms ease, background-color 220ms ease;
}

.ml-panel__reset-btn:hover,
.ml-panel__reset-btn:focus-visible {
  border-color: #669bbc;
  color: #ffffff;
  background: rgba(102, 155, 188, 0.14);
}

.ml-score-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.95rem;
  margin: 0 0 0.55rem;
}

.ml-score-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: rgba(253, 240, 213, 0.9);
  font-family: "Montserrat", var(--font-body);
}

.ml-score-legend__dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #071018;
}

.ml-score-legend__dot--ideal {
  border: 2px solid #5f8f67;
  box-shadow: inset 0 0 7px rgba(95, 143, 103, 0.3), 0 0 8px rgba(95, 143, 103, 0.42);
}

.ml-score-legend__dot--adequate {
  border: 2px solid #c9a24a;
  box-shadow: inset 0 0 7px rgba(201, 162, 74, 0.3), 0 0 8px rgba(201, 162, 74, 0.42);
}

.ml-score-legend__dot--transform {
  border: 2px solid #d7863a;
  box-shadow: inset 0 0 7px rgba(215, 134, 58, 0.3), 0 0 8px rgba(215, 134, 58, 0.42);
}

.ml-panel__group {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(253, 240, 213, 0.14);
}

.ml-panel__group-title {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #669bbc;
  letter-spacing: 0.06em;
  font-family: "Montserrat", var(--font-body);
  font-weight: 600;
}

.ml-panel__active-branch {
  margin: 0 0 0.7rem;
  font-size: 0.86rem;
  color: #fdf0d5;
  font-family: "Montserrat", var(--font-body);
  font-weight: 500;
}

.ml-question {
  margin-bottom: 0.7rem;
  padding: 0.65rem;
  background: rgba(13, 25, 36, 0.65);
  border: 1px solid rgba(253, 240, 213, 0.15);
  position: relative;
}

.ml-question__header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}

.ml-question__required {
  font-size: 0.68rem;
  padding: 0.15rem 0.42rem;
  border: 1px solid rgba(253, 240, 213, 0.22);
  color: #fdf0d5;
}

.ml-question__fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.ml-question__legend {
  font-size: 0.87rem;
  margin-bottom: 0.5rem;
  max-width: 100%;
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.24;
}

.ml-question__legend-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding-left: 26px;
  min-height: 28px;
  width: 100%;
}

.ml-question__icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  position: absolute;
  top: 10px;
  left: 6px;
  z-index: 2;
  pointer-events: none;
}

.ml-question__legend-text {
  display: block;
  width: 100%;
  flex: 1 1 auto;
}

.ml-question--entry .ml-question__legend {
  max-width: 100%;
}

.ml-question__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ml-option {
  border: 1px solid rgba(253, 240, 213, 0.23);
  background: transparent;
  color: rgba(253, 240, 213, 0.84);
  font-size: 0.78rem;
  padding: 0.34rem 0.52rem;
  transition: border-color 220ms ease, color 220ms ease, background-color 220ms ease;
}

.ml-option:hover,
.ml-option:focus-visible {
  border-color: #669bbc;
  color: #ffffff;
}

.ml-option.is-selected {
  border-color: #669bbc;
  background: rgba(102, 155, 188, 0.18);
  color: #ffffff;
}

.ml-panel__hint {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  color: rgba(253, 240, 213, 0.78);
}

.ml-state-chip {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.46rem;
  border: 1px solid currentColor;
}

.ml-state-chip--filtered { color: #8f97a0; }
.ml-state-chip--transform { color: #d7863a; }
.ml-state-chip--adequate { color: #c9a24a; }
.ml-state-chip--ideal { color: #5f8f67; }

.ml-reason--favored {
  color: #5f8f67;
  font-weight: 600;
}

.ml-reason--penalized {
  color: #d7863a;
  font-weight: 600;
}

.ml-node-label {
  font-family: "Inter", var(--font-body);
  letter-spacing: 0.01em;
  fill: #fdf0d5;
}

.ml-node-label--branch {
  font-size: 9px;
  font-family: "Montserrat", var(--font-body);
  font-weight: 500;
}

.ml-node-label--algorithm {
  font-size: 8px;
  font-weight: 500;
}

.ml-node--algorithm {
  cursor: pointer;
}

.ml-detail-tooltip {
  position: fixed;
  width: min(420px, 86vw);
  z-index: 1200;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 220ms ease;
}

.ml-detail-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ml-tooltip-card {
  border: 1px solid rgba(253, 240, 213, 0.26);
  background: rgba(7, 19, 29, 0.97);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.5);
  padding: 0.75rem;
}

.ml-tooltip-card__header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.ml-tooltip-card__header h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #fdf0d5;
  font-family: "Montserrat", var(--font-body);
  font-weight: 600;
}

.ml-tooltip-card__summary {
  margin: 0.42rem 0 0.62rem;
  font-size: 0.83rem;
  color: rgba(253, 240, 213, 0.85);
}

.ml-tooltip-card__meta {
  margin: 0.3rem 0 0.35rem;
  font-size: 0.72rem;
  color: rgba(253, 240, 213, 0.72);
  font-family: "Montserrat", var(--font-body);
}

.ml-tooltip-card__block h3,
.ml-tooltip-card__cols h3 {
  margin: 0.45rem 0 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #669bbc;
  font-family: "Montserrat", var(--font-body);
  font-weight: 600;
}

.ml-tooltip-card__block ul,
.ml-tooltip-card__cols ul {
  margin: 0;
  padding-left: 1rem;
}

.ml-tooltip-card__block li,
.ml-tooltip-card__cols li {
  font-size: 0.76rem;
  margin: 0.22rem 0;
}

.ml-tooltip-card__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.ml-map-error {
  padding: 1rem;
  border: 1px solid rgba(193, 18, 31, 0.65);
  background: rgba(193, 18, 31, 0.1);
  color: #fdf0d5;
}

.ml-map-error__meta {
  opacity: 0.75;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .ml-map-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(210px, 0.55fr);
  }
}

@media (max-width: 920px) {
  .ml-map-layout {
    grid-template-columns: 1fr;
  }

  .ml-map-layout__panel {
    position: static;
  }

  .ml-panel-content {
    padding-top: 0.8rem;
  }

  .ml-map-layout__tree {
    min-height: 640px;
  }

  .ml-tree-svg {
    min-width: 920px;
  }

  .ml-detail-tooltip {
    display: none;
  }
}
