.packet-route {
  width: var(--course-measure);
  margin: clamp(42px, 8vw, 96px) auto;
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: start;
}

.signal-selector {
  position: sticky;
  top: 18px;
  background: var(--subnet-black);
  color: var(--patch-white);
  border: 1px solid var(--rack-smoke);
  border-radius: var(--socket-curve);
  padding: 18px;
  box-shadow: var(--wire-lift);
}

.signal-selector fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.signal-selector legend {
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  line-height: 1.08;
  font-weight: 900;
  margin-bottom: 14px;
}

.role-port {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.role-port input {
  accent-color: var(--terminal-glow);
}

.role-port:has(input:checked) {
  border-color: var(--terminal-glow);
  background: rgba(216, 242, 111, 0.13);
}

.selector-readout {
  display: block;
  margin-top: 16px;
  padding: 14px;
  color: var(--patch-white);
  background: rgba(35, 139, 99, 0.25);
  border-left: 5px solid var(--terminal-glow);
  min-height: 112px;
}

.station-cable {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.station-leg {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--socket-line);
  border-radius: var(--socket-curve);
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(29, 37, 38, 0.1);
}

.station-leg.is-active {
  border-color: var(--route-green);
}

.station-lever {
  width: 100%;
  min-height: 118px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--subnet-black);
  text-align: left;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-rows: auto auto;
  cursor: pointer;
}

.station-lever:focus-visible {
  outline: 4px solid rgba(36, 93, 145, 0.35);
  outline-offset: -4px;
}

.station-number {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  background: var(--server-blue);
  color: white;
  font-size: 1.65rem;
  font-weight: 900;
}

.station-lever strong {
  padding: 18px 18px 2px;
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  line-height: 1.08;
}

.station-lever span:last-child {
  padding: 0 18px 18px;
  color: #4a5553;
}

.station-drawer {
  border-top: 1px solid var(--socket-line);
  padding: 18px 22px 22px 104px;
  background: #fffefa;
}

.station-drawer p {
  margin: 0 0 12px;
}

.drill-fragments {
  margin: 0;
  padding-left: 18px;
  columns: 2;
  column-gap: 28px;
}

.cohort-chooser {
  width: var(--course-measure);
  margin: 0 auto clamp(42px, 8vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.8fr);
  grid-template-areas:
    "title photo"
    "keys photo"
    "out photo";
  gap: 18px 28px;
  align-items: start;
}

.bay-titleline {
  grid-area: title;
}

.bay-titleline h2 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4.3rem);
  line-height: 0.98;
  max-width: 9.4em;
}

.cohort-keys {
  grid-area: keys;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.cohort-key {
  border: 2px solid var(--socket-line);
  background: var(--patch-white);
  color: var(--subnet-black);
  min-height: 48px;
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
}

.cohort-key.is-chosen {
  border-color: var(--notice-copper);
  background: var(--paper-tag);
  box-shadow: inset 0 -5px 0 rgba(185, 110, 66, 0.22);
}

.cohort-output {
  grid-area: out;
  display: block;
  padding: clamp(18px, 3vw, 28px);
  border-left: 10px solid var(--notice-copper);
  background: white;
  box-shadow: var(--wire-lift);
  font-size: 1.08rem;
  min-height: 132px;
}

.lab-photograph {
  grid-area: photo;
  margin: 0;
  align-self: stretch;
  background: var(--subnet-black);
  color: white;
  border-radius: var(--socket-curve);
  overflow: hidden;
  box-shadow: var(--wire-lift);
}

.lab-photograph img {
  width: 100%;
  height: min(560px, 52vw);
  min-height: 360px;
  object-fit: cover;
}

.lab-photograph figcaption {
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.84);
}

.call-socket {
  width: var(--course-measure);
  margin: 0 auto clamp(42px, 8vw, 96px);
  display: grid;
  grid-template-columns: minmax(250px, 0.6fr) minmax(0, 1fr);
  gap: 20px 34px;
  background: var(--paper-tag);
  border: 1px solid #d7d0bc;
  border-radius: 28px 28px 8px 8px;
  padding: clamp(20px, 4vw, 38px);
}

.call-socket h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.7rem);
  line-height: 0.98;
}

.call-socket > p {
  margin: 0;
  align-self: end;
  font-size: 1.05rem;
}

.call-brief {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(120px, 0.35fr) minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.call-field {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.call-field input,
.call-field select,
.call-field textarea {
  width: 100%;
  border: 1px solid #aaa187;
  background: #fffefa;
  color: var(--subnet-black);
  min-height: 44px;
  padding: 10px 11px;
  font: inherit;
}

.challenge-wire textarea {
  resize: vertical;
}

.line-commit {
  border: 0;
  background: var(--route-green);
  color: white;
  min-height: 46px;
  padding: 11px 16px;
  font-weight: 900;
  cursor: pointer;
}

.line-commit:hover,
.line-commit:focus-visible {
  background: var(--server-blue);
}

.brief-output {
  grid-column: 1 / -1;
  display: block;
  padding: 14px 16px;
  background: white;
  border-left: 7px solid var(--server-blue);
  min-height: 64px;
}

@media (max-width: 920px) {
  .packet-route,
  .cohort-chooser,
  .call-socket {
    grid-template-columns: 1fr;
  }

  .signal-selector {
    position: static;
  }

  .cohort-chooser {
    grid-template-areas:
      "title"
      "keys"
      "out"
      "photo";
  }

  .call-brief {
    grid-template-columns: 1fr 1fr;
  }

  .challenge-wire,
  .line-commit {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .station-lever {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .station-number {
    font-size: 1.2rem;
  }

  .station-drawer {
    padding: 16px;
  }

  .drill-fragments {
    columns: 1;
  }

  .call-brief {
    grid-template-columns: 1fr;
  }

  .lab-photograph img {
    height: 310px;
    min-height: 310px;
  }
}
