.subnet-figure {
  margin: 1rem 0 0;
  padding: clamp(.7rem, 2vw, 1.15rem);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}

.subnet-figure figcaption {
  margin-bottom: .65rem;
  color: var(--green);
  font-size: 1.12rem;
  font-weight: 750;
}

.subnet-figure p,
.subnet-figure ol {
  margin-bottom: .8rem;
}

.subnet-figure p:last-child {
  margin-bottom: 0;
}

.subnet-figure summary {
  color: var(--green);
}

.subnet-figure .subnet-prefix {
  background: var(--mint);
  color: var(--ink);
}

.subnet-figure .subnet-host {
  background: var(--blue);
  color: var(--ink);
}

.subnet-bit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.5fr);
  align-items: center;
  gap: .35rem;
  max-width: 28rem;
  margin: .75rem 0;
  font-size: .86rem;
}

.subnet-bit-grid > code {
  padding: .3rem .15rem;
  letter-spacing: .11em;
  text-align: center;
}

.subnet-bit-grid > strong {
  color: var(--muted);
  text-align: center;
}

.subnet-endpoints,
.subnet-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: .45rem;
  margin: .75rem 0;
}

.subnet-endpoints > div,
.subnet-cards > div {
  min-width: 0;
  padding: .45rem .55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  font-size: .83rem;
  line-height: 1.5;
}

.subnet-endpoints b,
.subnet-cards b,
.subnet-cards small {
  display: block;
}

.subnet-cards small {
  color: var(--muted);
  font-size: .95em;
}

.subnet-endpoints > div:nth-child(2) {
  background: var(--mint);
}

.subnet-parent {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem .5rem;
  margin-bottom: .3rem;
  font-size: .88rem;
}

.subnet-parent span {
  color: var(--muted);
}

.subnet-bands {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--control-border, var(--line));
  border-radius: 7px;
}

.subnet-bands-equal {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.subnet-bands-vlsm {
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr) minmax(0, 1fr) minmax(0, 3fr);
}

.subnet-bands span {
  display: grid;
  place-items: center;
  min-height: 1.65rem;
  background: var(--mint);
  font: 700 .82rem Consolas, monospace;
}

.subnet-bands span + span {
  border-inline-start: 1px solid var(--control-border, var(--line));
}

.subnet-bands span:nth-child(2) {
  background: var(--blue);
}

.subnet-bands span:nth-child(3) {
  background: var(--violet);
}

.subnet-bands span:nth-child(4) {
  background: var(--control);
}

.subnet-cards > div {
  border-block-start: 4px solid var(--mint);
}

.subnet-cards > div:nth-child(2) {
  border-block-start-color: var(--blue);
}

.subnet-cards > div:nth-child(3) {
  border-block-start-color: var(--violet);
}

.subnet-cards > div:nth-child(4),
.subnet-summary > div {
  border-block-start-color: var(--line);
}

.subnet-summary > div:nth-child(n) {
  border-block-start-color: var(--control-border, var(--line));
}

.subnet-reference {
  padding-top: .6rem;
  font-size: .86rem;
}
