.ex-diagram {
  --diagram-ink: #061a2d;
  --diagram-teal: #005673;
  --diagram-coral: #bd4535;
  --diagram-border: #dfd3bf;
  --diagram-hub-width: 144px;
  --diagram-tile-width: 124px;
  --diagram-gap: 32px;
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 30px 28px 24px;
  border: 1px solid var(--diagram-border);
  border-radius: 22px;
  color: var(--diagram-ink);
  background: radial-gradient(ellipse at 50% 42%, #f0f5d644, transparent 60%), #fffdf8;
  box-shadow: 0 4px 0 #dfd5c52e;
  container: example-diagram / inline-size;
}

.ex-diagram,
.ex-diagram * {
  box-sizing: border-box;
}

.ex-diagram__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--diagram-hub-width) minmax(0, 1fr);
  gap: var(--diagram-gap);
  min-height: 326px;
}

.ex-diagram__group {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.ex-diagram .ex-diagram__heading {
  height: 20px;
  margin: 0 0 22px;
  color: var(--diagram-teal);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.ex-diagram .ex-diagram__group--out .ex-diagram__heading {
  color: var(--diagram-coral);
}

.ex-diagram__chips {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ex-diagram__chips li {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 72px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #c7d9d5;
  border-radius: 12px;
  background: linear-gradient(130deg, #fffefa, #f3f8f5);
  box-shadow: 0 3px 0 #c6d5cd24;
}

.ex-diagram__chips li::before {
  content: none;
}

.ex-diagram__chips li > span:last-child {
  min-width: 0;
  color: #173b46;
  font-size: 14.5px;
  font-weight: 570;
  line-height: 1.35;
  letter-spacing: -.2px;
}

.ex-diagram__icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid #cbded6;
  border-radius: 50%;
  color: var(--diagram-teal);
  background: #e7f0ea;
}

.ex-diagram__icon svg {
  display: block;
  width: 21px;
  height: 21px;
}

.ex-diagram__group--out .ex-diagram__chips li {
  border-color: #e7c9b8;
  background: linear-gradient(130deg, #fffdf8, #fff3e9);
  box-shadow: 0 3px 0 #dec5b124;
}

.ex-diagram__group--out .ex-diagram__chips li > span:last-child {
  color: #694036;
}

.ex-diagram__group--out .ex-diagram__icon {
  border-color: #edc9b6;
  color: var(--diagram-coral);
  background: #fae6d8;
}

.ex-diagram__hub {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding-top: 100px;
  text-align: center;
}

.ex-diagram__glow {
  position: absolute;
  z-index: -1;
  top: 39px;
  left: 50%;
  width: 242px;
  height: 254px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, #dff07880, #f1f6d544 58%, transparent 74%);
  pointer-events: none;
}

.ex-diagram__glow i {
  position: absolute;
  inset: 0;
  border: 1px dashed #6babad3b;
  border-radius: 50%;
}

.ex-diagram__glow i + i {
  inset: 22px;
  border-style: solid;
  border-color: #8bae9b42;
}

.ex-diagram__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: var(--diagram-tile-width);
  height: 140px;
  padding: 14px;
  border: 1px solid #b9d72d;
  border-radius: 22px;
  background: linear-gradient(150deg, #080d0b, #171e15 58%, #080c09);
  box-shadow: 0 5px 0 #c8d7684d, 0 14px 28px #9bb7481c;
}

.ex-diagram__mark {
  display: grid;
  place-items: center;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  padding: 3px;
  border-radius: 16px;
  background: #fffefa;
}

.ex-diagram .ex-diagram__mark img {
  display: block;
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.ex-diagram__tile > strong {
  margin-top: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 720;
  line-height: 26px;
  letter-spacing: -.65px;
}

.ex-diagram__hub-caption {
  width: 184px;
  max-width: none;
  margin-top: 18px;
}

.ex-diagram__hub-caption > strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  line-height: 21px;
  letter-spacing: -.3px;
}

.ex-diagram__hub-caption > span {
  display: block;
  margin-top: 7px;
  color: #55645e;
  font-size: 13px;
  line-height: 19px;
}

/* The existing SVG connects chip centers at 78, 170, and 262px.
   Its horizontal span also includes the inset between the hub and its tile. */
.ex-diagram__wires {
  position: absolute;
  z-index: 1;
  top: -2.75px;
  width: calc(var(--diagram-gap) + (var(--diagram-hub-width) - var(--diagram-tile-width)) / 2);
  height: 328px;
  overflow: visible;
  pointer-events: none;
}

.ex-diagram__wires--in {
  left: calc((100% - var(--diagram-hub-width) - var(--diagram-gap) - var(--diagram-gap)) / 2);
  color: #277383;
}

.ex-diagram__wires--out {
  left: calc((100% - var(--diagram-hub-width) - var(--diagram-gap) - var(--diagram-gap)) / 2 + var(--diagram-gap) + (var(--diagram-hub-width) + var(--diagram-tile-width)) / 2);
  color: #de725b;
}

.ex-diagram__wires path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.ex-diagram__wires circle {
  fill: currentColor;
}

.ex-diagram__controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e3d8c5;
  color: #4f615a;
}

.ex-diagram__controls > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 520;
  line-height: 20px;
}

.ex-diagram__controls svg {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--diagram-teal);
}

.ex-diagram__controls > span + span svg {
  color: var(--diagram-coral);
}

@container example-diagram (min-width: 500px) and (max-width: 579px) {
  .ex-diagram__stage {
    --diagram-hub-width: 128px;
    --diagram-tile-width: 112px;
    --diagram-gap: 24px;
  }

  .ex-diagram__chips li {
    gap: 8px;
    padding: 9px;
  }

  .ex-diagram__chips li > span:last-child {
    font-size: 14px;
  }

  .ex-diagram__icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .ex-diagram__icon svg {
    width: 19px;
    height: 19px;
  }

  .ex-diagram__hub {
    padding-top: 107px;
  }

  .ex-diagram__tile {
    height: 126px;
    padding: 12px;
    border-radius: 20px;
  }

  .ex-diagram__mark {
    flex-basis: 68px;
    width: 68px;
    height: 68px;
    border-radius: 14px;
  }

  .ex-diagram .ex-diagram__mark img {
    width: 62px;
    height: 62px;
  }

  .ex-diagram__tile > strong {
    margin-top: 7px;
    font-size: 20px;
    line-height: 24px;
  }

  .ex-diagram__hub-caption {
    width: 172px;
  }

  .ex-diagram__hub-caption > strong {
    font-size: 14px;
    line-height: 21px;
  }

  .ex-diagram__hub-caption > span {
    font-size: 12px;
  }
}

@container example-diagram (max-width: 499px) {
  .ex-diagram__stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
  }

  .ex-diagram__wires {
    display: none;
  }

  .ex-diagram .ex-diagram__heading {
    height: 18px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 18px;
    letter-spacing: .85px;
  }

  .ex-diagram__chips {
    gap: 6px;
  }

  .ex-diagram__chips li {
    height: auto;
    min-height: 36px;
    gap: 10px;
    padding: 5px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 0 #cec3b018;
  }

  .ex-diagram__chips li > span:last-child {
    font-size: 14px;
    font-weight: 550;
    line-height: 20px;
  }

  .ex-diagram__icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
  }

  .ex-diagram__icon svg {
    width: 16px;
    height: 16px;
  }

  .ex-diagram__hub {
    flex-direction: row;
    justify-content: center;
    gap: 14px;
    min-height: 100px;
    margin: 0;
    padding: 9px 0;
    text-align: left;
  }

  .ex-diagram__hub::before,
  .ex-diagram__hub::after {
    position: absolute;
    left: 50%;
    width: 1px;
    height: 9px;
    content: "";
  }

  .ex-diagram__hub::before {
    top: 0;
    background: #277383;
  }

  .ex-diagram__hub::after {
    bottom: 0;
    background: #de725b;
  }

  .ex-diagram__glow {
    top: -3px;
    width: min(100%, 252px);
    height: 106px;
  }

  .ex-diagram__glow i {
    inset: 5px 0;
  }

  .ex-diagram__glow i + i {
    inset: 15px 25px;
  }

  .ex-diagram__tile {
    width: 72px;
    height: 82px;
    padding: 7px;
    border-radius: 13px;
    box-shadow: 0 3px 0 #c8d7683b;
  }

  .ex-diagram__mark {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    padding: 2px;
    border-radius: 9px;
  }

  .ex-diagram .ex-diagram__mark img {
    width: 40px;
    height: 40px;
  }

  .ex-diagram__tile > strong {
    margin-top: 4px;
    font-size: 15px;
    line-height: 18px;
    letter-spacing: -.35px;
  }

  .ex-diagram__hub-caption {
    width: auto;
    max-width: 164px;
    margin: 0;
  }

  .ex-diagram__hub-caption > strong {
    font-size: 14px;
    line-height: 20px;
  }

  .ex-diagram__hub-caption > span {
    margin-top: 4px;
    font-size: 12px;
    line-height: 18px;
  }

  .ex-diagram__controls {
    gap: 8px 18px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .ex-diagram__controls > span {
    gap: 6px;
    font-size: 12px;
    line-height: 18px;
  }

  .ex-diagram__controls svg {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 760px) {
  .ex-diagram {
    padding: 16px 15px;
    border-radius: 15px;
    box-shadow: 0 3px 0 #dfd5c525;
  }
}
