.top nav a {
  color: #c0dce0;
  text-decoration: none;
  margin-left: 15px;
}
.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 10px 0 16px;
}
.action-row output {
  font-variant-numeric: tabular-nums;
  color: #425956;
}
.primary {
  background: #23635c;
  color: white;
  border-color: #23635c;
}
.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.edit-grid section {
  background: white;
  border: 1px solid #ccd6d2;
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}
.edit-grid h2 {
  margin-top: 0;
  font-size: 20px;
}
.edit-grid p {
  color: #49605f;
}
.edit-grid label,
.heading label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0;
}
.edit-grid select {
  max-width: 100%;
}
.edit-grid input {
  width: 85px;
}
.edit-grid textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 185px;
  margin: 10px 0;
  resize: vertical;
  font:
    13px/1.6 Consolas,
    monospace;
  color: #203c40;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
}
pre {
  overflow: auto;
  max-height: 28rem;
  font-size: 12px;
}
#parents button {
  margin: 3px;
}
.workbench aside {
  overflow-wrap: anywhere;
}
.transport input {
  flex: 1;
  min-width: 30px;
}
@media (max-width: 800px) {
  .edit-grid {
    grid-template-columns: 1fr;
  }
  .heading {
    flex-wrap: wrap;
  }
  .edit-grid label {
    flex-wrap: wrap;
    max-width: 100%;
  }
}
#signalPanel {
  padding: 14px 18px;
  background: white;
  border: 1px solid #ccd6d2;
  border-radius: 8px;
  margin-top: 16px;
}
#signalPlot {
  display: block;
  width: 100%;
  height: 140px;
}
.assembly-tools {
  padding: 8px 12px;
  background: #edf3f1;
  margin: 0;
  border-bottom: 1px solid #cdd9d4;
}
.assembly-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.assembly-tools select {
  max-width: 190px;
}
#partEditor input {
  width: 140px;
}
.heading label {
  max-width: 100%;
  min-width: 0;
}
#example {
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}
@media (max-width: 650px) {
  .heading label {
    width: 100%;
  }
}
#machinePlatforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}
#machinePlatforms button {
  border-radius: 4px;
}
#machinePlatforms button[aria-pressed="true"] {
  background: #1e5555;
  color: #fff;
  border-color: #1e5555;
}
.machine-views {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.workbench.has-device {
  grid-template-columns: minmax(0, 1fr);
}
.has-device .viewport {
  min-height: clamp(415px, 38vw, 640px);
}
.has-device aside {
  border-left: 0;
  border-top: 1px solid #bdccc9;
}
#sceneControls {
  display: flex;
  align-items: center;
  gap: 7px;
}
#sceneControls label {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  background: #203337e8;
  padding: 4px 7px;
  border-radius: 4px;
}
#sceneControls input {
  accent-color: #92d8be;
}
#sceneControls[hidden],
#devicePanel[hidden],
#drivePath[hidden] {
  display: none;
}
#devicePanel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 16px;
  align-items: center;
  padding: 11px 16px;
  background: #192f34;
  color: #d9ebe7;
  border-top: 1px solid #41585c;
}
.device-heading,
.drive-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.drive-controls {
  justify-content: flex-end;
}
.device-heading h2 {
  margin: 0;
  font-size: 16px;
  color: #eff6f3;
}
#registerCount {
  font-size: 13px;
  color: #a3dfd2;
  white-space: nowrap;
}
#devicePanel button {
  background: #213c43;
  color: #d3e5e3;
  border: 1px solid #486369;
  padding: 3px 8px;
}
#driveReadout,
#qubitInspector,
#drivePath,
#devicePanel details {
  color: #bcd7d1;
  font-size: 12px;
  margin: 0;
}
#drivePath {
  color: #f8cf9b;
}
#qubitList,
#drivePath,
#qubitInspector,
#devicePanel details {
  grid-column: 1/-1;
}
#qubitList {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-height: 90px;
  overflow: auto;
}
#qubitList button {
  font:
    11px/1.4 Consolas,
    monospace;
  padding: 2px 5px;
}
#qubitList button[aria-pressed="true"] {
  outline: 1px solid #e4d293;
  color: #fff0c4;
}
#qubitList button.driven,
.qubit-tag.driven {
  background: #824a30;
  color: #ffeadb;
}
.qubit-tag {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  font:
    11px/1.2 Consolas,
    monospace;
  padding: 2px 4px;
  border: 0;
  border-radius: 3px;
  background: #162d33e6;
  color: #c4fff3;
}
.qubit-tag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 6px;
  background: #99cdc5;
  pointer-events: none;
}
#devicePanel details p {
  margin: 4px 0;
}
#devicePanel a {
  color: #b8e9e4;
}
#pulsePanel {padding:16px 18px;background:#f5f8f7;color:#203e41;border-top:1px solid #b8ccc5;min-width:0}
#pulsePanel header,.pulse-tools {display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#pulsePanel h2,#pulsePanel h3 {font-size:16px;margin:0}
#pulseChoice {max-width:100%}
#pulseOrigin,#pulseAt,#pulseCarriers p {font-size:13px;color:#486260;overflow-wrap:anywhere}
#pulseHops {padding-left:1.8em;max-height:19rem;overflow:auto}
#pulseHops li {padding:4px 6px;font-size:13px}
#pulseHops li[aria-current=true] {background:#f9e6ca}
#pulseHops button,#pulseCauses button,#pulseCarriers button {font-size:12px;padding:3px 7px;margin:2px 5px 2px 0;overflow-wrap:anywhere;max-width:100%;white-space:normal}
#pulseHops .wire-ref {color:#286966;background:transparent;border-color:#a8c1ba;margin-left:6px}
#pulsePanel summary {cursor:pointer;color:#335956}
@media (max-width: 720px) {
  .has-device .viewport {
    min-height: 300px;
  }
  .has-device .viewbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    left: 8px;
    right: 8px;
  }
  .has-device .viewhint {
    max-width: 56%;
    font-size: 10px;
  }
  #sceneControls {
    gap: 3px;
  }
  #sceneControls label,
  #sceneControls button {
    font-size: 11px;
    padding: 4px;
  }
  #devicePanel {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .drive-controls {
    justify-content: flex-start;
  }
}
