.representation-board {
  max-width: 940px;
  margin-inline: auto;
  padding: clamp(.65rem, 2vw, 1.3rem);
  background: #fffaee;
  border: 1px solid var(--line);
  border-radius: var(--diagram-group-radius);
}

.representation-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
}

.representation-flow > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.representation-flow small,
.adc-trace small,
.encoding-fork small {
  display: block;
  font-size: .84em;
}

.representation-flow > .flow-arrow { width: clamp(1.2rem, 5vw, 4.4rem); }
.adc-input { max-width: 620px; margin: 0 auto .5rem; }
.representation-mic { width: 60px; height: 56px; }
.representation-mic rect { fill: var(--cyan); }
.representation-mic :is(path, rect) {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}
.representation-mic path { fill: none; }

.adc-chart { display: block; width: 100%; height: auto; overflow: visible; }
.adc-chart path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.adc-chart text { fill: var(--ink); font: 700 15px var(--sans); }
.adc-grid { stroke: #b8ad98; stroke-width: 1; }
.adc-guides { stroke: #8d7e6a; stroke-width: 1; stroke-dasharray: 3 4; }
.adc-axis { stroke: var(--ink); stroke-width: 2; }
.adc-wave { stroke: var(--teal); stroke-width: 3; }
.adc-round { stroke: var(--wine); stroke-width: 2; }
.adc-samples, .adc-dot { fill: var(--yellow); background: var(--yellow); stroke: var(--ink); stroke-width: 1.5; }
.adc-levels, .adc-square { fill: var(--pink); background: var(--pink); stroke: var(--wine); stroke-width: 1.5; }
.adc-dot, .adc-square {
  display: inline-block;
  width: .68rem;
  height: .68rem;
  margin-right: .32rem;
  border: 1px solid var(--ink);
}
.adc-dot { border-radius: 50%; }
.adc-square { border-color: var(--wine); }
.adc-trace { width: 100%; table-layout: fixed; text-align: center; border-collapse: collapse; }
.adc-trace :is(th, td) { width: 20%; padding: .25rem .22rem; border-bottom: 1px solid var(--line); }
.adc-trace thead { background: #f4eadd; }
.adc-trace tbody th { text-align: left; }
.adc-trace td { border-left: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.adc-trace tr:last-child td { background: #e4f4e9; }
.adc-trace :target { outline: 2px solid var(--wine); outline-offset: -2px; }
.adc-output { margin-top: .65rem; display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; justify-content: center; }
.adc-output code, .adc-trace code, .encoding-byte { color: var(--teal); font-size: 1.08em; font-weight: 750; }
.adc-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.adc-detail > div { min-width: 0; padding: .75rem; background: #fffaee; border-top: 3px solid var(--teal); }
.adc-detail > div + div { border-color: var(--wine); }
.adc-detail :is(h3, p) { margin: 0; }
.adc-detail p { margin-top: .45rem; }

.encoding-origin { display: grid; justify-content: center; }
.encoding-glyph {
  display: grid;
  min-height: 2.3em;
  min-width: 2.1em;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: .35rem;
  background: var(--white);
  font-size: 1.5rem;
  font-weight: 750;
  line-height: 1;
}
.encoding-fork {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
  gap: 1.2rem;
  margin-top: 2rem;
  text-align: center;
}
.encoding-fork::before {
  position: absolute;
  content: "";
  top: -.9rem;
  left: 16%;
  right: 16%;
  border-top: 2px solid var(--ink);
}
.encoding-fork > div { position: relative; border-top: 3px solid var(--teal); padding: .5rem .15rem; }
.encoding-fork > div:nth-child(2) { border-color: var(--wine); }
.encoding-fork > div:nth-child(3) { border-color: #977325; }
.encoding-fork > div::before {
  position: absolute;
  content: "";
  bottom: calc(100% + 3px);
  left: 50%;
  height: .9rem;
  border-left: 2px solid var(--ink);
}
.encoding-fork > div:nth-child(2)::before { height: 1.75rem; }
.encoding-fork > div::after {
  position: absolute;
  content: "";
  top: -.5rem;
  left: calc(50% - .22rem);
  width: .45rem;
  height: .45rem;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.encoding-byte { display: inline-block; padding: 0 .28rem; background: #e4f4e9; white-space: nowrap; }
.encoding-control { background: #f7e9b5; color: var(--ink); }
.encoding-decode {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 2fr);
  --decode-branch: 1.3rem;
  align-items: center;
}
.encoding-file {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: .35rem;
  margin-right: calc(var(--decode-branch) + .18rem);
}
.encoding-file img { width: 64px; height: auto; }
.encoding-file b { display: block; }
.encoding-lanes {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: .65rem;
  padding-left: var(--decode-branch);
}
.encoding-lanes::before {
  position: absolute;
  content: "";
  left: 0;
  top: calc(25% - .1625rem);
  bottom: calc(25% - .1625rem);
  border-left: 2px solid var(--ink);
}
.encoding-lanes::after {
  position: absolute;
  content: "";
  top: 50%;
  right: 100%;
  width: var(--decode-branch);
  border-top: 2px solid var(--ink);
}
.encoding-lane {
  position: relative;
  display: grid;
  grid-template-columns: 9.5rem clamp(1.2rem, 4vw, 3.2rem) minmax(0, 1fr);
  gap: .6rem;
  align-items: center;
}
.encoding-lane::before {
  position: absolute;
  content: "";
  top: 50%;
  right: calc(100% + .2rem);
  width: calc(var(--decode-branch) - .2rem);
  border-top: 2px solid var(--ink);
}
.encoding-lane .flow-arrow { width: 100%; }
.encoding-lane > span:last-child { justify-self: start; }
.encoding-lane small { display: block; }
.encoding-lookup { width: 100%; text-align: center; border-collapse: collapse; margin-top: 1rem; }
.encoding-lookup :is(th, td) { padding: .35rem .25rem; border: 1px solid var(--line); }
.encoding-lookup .encoding-match { background: var(--yellow); }

@media (max-width: 660px) {
  .adc-chart text { font-size: 18px; }
  .adc-trace th { font-size: .82rem; }
  .adc-detail, .encoding-decode { grid-template-columns: 1fr; }
  .encoding-fork { grid-template-columns: 1fr; gap: .75rem; margin-top: 1rem; }
  .encoding-fork::before, .encoding-fork > div::before, .encoding-fork > div::after,
  .encoding-lanes::after { display: none; }
  .encoding-file { justify-self: center; margin-right: 0; }
  .encoding-lanes { margin-top: .85rem; }
  .encoding-lane { grid-template-columns: minmax(0, 1fr) 1.2rem minmax(0, 1fr); }
}
