.hardware-chapter {
  display: grid;
  gap: 22px;
}

.hardware-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: 8px 20px;
  margin-bottom: 18px;
}

.hardware-section-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.hardware-section-head .lesson-refs {
  margin-top: 6px;
}

.hardware-overview-layout,
.hardware-reading-layout {
  display: grid;
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
}

.hardware-overview-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr);
}

.hardware-reading-layout {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.hardware-topics {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.hardware-topics a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 650;
}

.hardware-topics a span,
.hardware-topics a:hover {
  color: var(--accent);
}

.hardware-figure {
  border: 1px solid var(--line);
  background: #fff;
}

.hardware-figure img {
  width: 100%;
  height: auto;
}

.hardware-pcb-figure img {
  width: min(100%, 530px);
  margin-inline: auto;
}

.hardware-figure figcaption {
  border-top: 1px solid var(--line);
  background: var(--paper-hi);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.hardware-reading p,
.hardware-circuits dd,
.hardware-layout-note p,
.hardware-exercise li,
.hardware-answer p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.hardware-circuits > div,
.hardware-module-part + .hardware-module-part {
  border-top: 1px solid var(--line);
}

.hardware-circuits > div {
  margin-top: 11px;
  padding-top: 11px;
}

.hardware-circuits dt {
  font-size: 14px;
  font-weight: 700;
}

.hardware-tabs button {
  min-height: 44px;
}

.hardware-tabs button:hover {
  border-color: var(--accent);
}

.hardware-module-part {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(16px, 3vw, 40px);
}

.hardware-module-part + .hardware-module-part {
  margin-top: clamp(16px, 2vw, 26px);
  padding-top: clamp(16px, 2vw, 26px);
}

.hardware-diagram-link {
  display: block;
}

.hardware-diagram figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 10px;
}

.hardware-diagram-link:hover figcaption,
.hardware-diagram figcaption span {
  color: var(--accent);
}

.hardware-figure-portrait {
  width: min(100%, 350px);
  justify-self: center;
}

.hardware-module-copy {
  color: var(--muted);
  font-size: 15px;
}

.hardware-module-copy h3 {
  color: var(--ink);
  margin-bottom: 8px;
}

.hardware-module-copy p + p {
  margin-top: 10px;
}

.hardware-module-copy code {
  font-size: .9em;
}

.hardware-layout-note {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}

#lesson-body .hardware-layout-note h3 {
  font-size: 15px;
}

.hardware-layout-note .lesson-refs {
  margin-top: 6px;
}

.hardware-exercise ol {
  padding-inline-start: 1.5rem;
}

.hardware-answer {
  max-width: 72ch;
}

.hardware-answer summary {
  width: fit-content;
  min-height: 44px;
  padding: 10px 4px;
  font-weight: 650;
  color: #a22432;
  cursor: pointer;
}

@media (max-width: 820px) {
  .hardware-overview-layout,
  .hardware-reading-layout,
  .hardware-module-part {
    grid-template-columns: minmax(0, 1fr);
  }

  .hardware-topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
  }

  .hardware-topics a {
    gap: 6px;
    padding-inline: 3px;
    font-size: 13px;
  }
}
