:root {
  font: var(--fs-md) var(--font-ui);
  color: var(--ink);
  background: var(--wash);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--n-0);
  color: var(--ink);
  padding: 7px 11px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: var(--wash);
  border-color: var(--n-400);
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-on-dark);
  outline-offset: 3px;
}
input,
select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--n-300);
  border-radius: var(--r-sm);
  padding: 8px 9px;
  color: var(--ink);
  background: var(--n-0);
}
input[type="radio"] {
  min-height: auto;
  width: auto;
  accent-color: var(--green);
}
input[type="checkbox"] {
  width: auto;
}
button.primary,
.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--n-0);
}
button.primary:hover {
  background: var(--accent-700);
}
button.danger {
  color: var(--fault-ink);
}
a {
  color: var(--green);
}
kbd {
  font: var(--fs-2xs) var(--font-mono);
  opacity: 0.55;
  padding-left: 5px;
}
.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 550px;
}
.topbar {
  height: 62px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--navy);
  color: var(--n-50);
  padding: 0 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}
.brand strong {
  font-size: var(--fs-3xl);
  letter-spacing: -0.7px;
}
.brand strong span {
  font-weight: 400;
  color: var(--accent-on-dark);
}
.edition {
  font: var(--fs-2xs) var(--font-mono);
  letter-spacing: 1.4px;
  margin-left: 3px;
  color: var(--z-muted-dark);
}
.topbar button {
  background: transparent;
  border-color: transparent;
  color: var(--n-100);
}
.topbar button:hover {
  background: var(--n-800);
}
.file-actions {
  display: flex;
  gap: 4px;
}
.connection-summary {
  color: var(--n-400);
  font: var(--fs-xs) var(--font-mono);
}
.project-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.eyebrow {
  font: var(--fs-2xs) var(--font-mono);
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.project-heading input {
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: -0.7px;
  max-width: 360px;
  width: 26vw;
  border-color: transparent;
  padding: 6px;
}
.project-heading input:hover {
  border-color: var(--line);
}
#save-state {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
}
.run-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.run-controls > span {
  font: var(--fs-2xs) var(--font-mono);
  letter-spacing: 1px;
  margin-right: 14px;
  white-space: nowrap;
}
.run-controls i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--n-400);
  margin-right: 6px;
}
.run-controls .running {
  color: var(--green);
}
.running i {
  background: var(--green);
}
.workbench {
  flex: 1;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr) 270px;
  min-height: 0;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--n-25);
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 8px;
}
.subtle {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.library-tool {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  border: 1px solid transparent;
  background: transparent;
  gap: 12px;
  margin: 2px 0;
  min-height: 44px;
  cursor: grab;
}
.library-symbol {
  font: var(--fs-xl) var(--font-mono);
  color: var(--green);
  width: 52px;
  flex-shrink: 0;
}
.library-tool:hover {
  background: var(--n-0);
  border-color: var(--line);
}
.library-tool:active {
  cursor: grabbing;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.workspace-tabs {
  display: flex;
  align-items: stretch;
  height: 49px;
  background: var(--n-0);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  padding: 0 16px;
  gap: 8px;
}
.workspace-tabs > button {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: var(--fs-sm);
  color: var(--muted);
  padding: 0 12px;
}
.workspace-tabs > button.active {
  color: var(--green);
  border-bottom: 2px solid var(--green);
  font-weight: 600;
}
.history-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
}
.history-controls button {
  border: 0;
  font-size: var(--fs-3xl);
  width: 31px;
  min-height: 29px;
  padding: 0;
}
.workspace-content {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
}
.ladder-pane,
.plant-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
}
.workspace-content[data-view="ladder"] .plant-pane,
.workspace-content[data-view="plant"] .ladder-pane {
  display: none;
}
.workspace-content[data-view="split"] {
  flex-direction: column;
}
.workspace-content[data-view="split"] .ladder-pane {
  flex: 1.1;
}
.workspace-content[data-view="split"] .plant-pane {
  border-top: 1px solid var(--line);
}
.canvas-toolbar {
  height: 55px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 23px;
  border-bottom: 1px solid var(--line);
  background: var(--n-25);
}
.canvas-toolbar strong {
  font-size: var(--fs-sm);
  font-weight: 600;
}
.canvas-toolbar select {
  width: auto;
  max-width: 170px;
}
.ladder-sheet {
  flex: 1;
  overflow: auto;
  padding: 29px 29px 45px;
  background-color: var(--n-25);
  background-image: radial-gradient(var(--n-200) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
}
.sheet-heading {
  display: flex;
  justify-content: space-between;
  font: var(--fs-2xs) var(--font-mono);
  letter-spacing: 1.6px;
  color: var(--n-600);
  margin-bottom: 25px;
  min-width: 460px;
}
.rung-block {
  border: 1px solid var(--line);
  border-left: 3px solid var(--n-300);
  background: color-mix(in srgb, var(--n-0) 93%, transparent);
  margin-bottom: 21px;
  border-radius: var(--r-sm);
  min-width: 480px;
  position: relative;
}
.rung-block.selected {
  border-left-color: var(--green);
  box-shadow: var(--sh-2);
}
.rung-header {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: var(--n-25);
  border-bottom: 1px solid var(--n-100);
  gap: 12px;
}
.rung-number {
  font: var(--fs-2xs) var(--font-mono);
  color: var(--green);
  white-space: nowrap;
}
.rung-comment {
  font-size: var(--fs-sm);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.rung-header button {
  border: 0;
  background: transparent;
  min-height: 24px;
  padding: 2px 7px;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.circuit {
  padding: 22px 18px 21px;
  overflow: auto;
}
.rung-line {
  display: flex;
  align-items: center;
  min-height: 105px;
  border-left: 3px solid var(--n-500);
  border-right: 3px solid var(--n-500);
  width: max-content;
  min-width: 100%;
  position: relative;
}
.rung-line:before {
  content: "";
  height: 2px;
  background: var(--n-400);
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
}
.ladder-cell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  background: var(--n-0);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  min-width: 94px;
  max-width: 135px;
  min-height: 88px;
  cursor: grab;
  flex-shrink: 0;
  padding: 8px;
}
.ladder-cell:hover {
  background: var(--n-25);
  border-color: var(--n-300);
}
.ladder-cell.selected {
  border-color: var(--green);
  background: var(--n-50);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-400) 7%, transparent);
}
.cell-address {
  font: var(--fs-2xs) var(--font-mono);
  color: var(--n-600);
}
.cell-tag {
  font: var(--fs-2xs) var(--font-mono);
  color: var(--accent-700);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-pin {
  font: var(--fs-2xs) var(--font-mono);
  color: var(--n-600);
}
.ladder-cell.activo:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
}
.drop-slot {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 26px;
  height: 70px;
  border: 1px dashed transparent;
  border-radius: var(--r-sm);
  background: transparent;
  padding: 0;
  opacity: 1;
  color: var(--z-muted-dark);
  font: var(--fs-3xl) var(--font-mono);
}
.drop-slot:hover,
.dragging .drop-slot {
  border-color: var(--accent-200);
  background: color-mix(in srgb, var(--n-50) 60%, transparent);
}
.drop-slot.over {
  border: 2px solid var(--green);
  background: var(--ok-bg);
}
.parallel-caption {
  font: var(--fs-2xs) var(--font-mono);
  color: var(--muted);
  margin-top: 12px;
}
.rung-empty {
  font-size: var(--fs-sm);
  color: var(--muted);
  padding: 10px 14px;
  position: relative;
  background: var(--n-0);
}
.add-rung-bottom {
  width: 100%;
  min-width: 480px;
  min-height: 44px;
  border-style: dashed;
  background: color-mix(in srgb, var(--n-0) 50%, transparent);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--n-0);
  font: var(--fs-2xs) var(--font-mono);
  color: var(--muted);
  min-height: 34px;
}
.statusbar > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.statusbar #status-message {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.statusbar > span {
  white-space: nowrap;
}
.status-release {
  flex-shrink: 0;
  border: 1px solid var(--n-300);
  border-radius: 999px;
  background: var(--n-25);
  color: var(--n-700);
  padding: 3px 8px;
  font: 600 var(--fs-2xs) var(--font-mono);
  white-space: nowrap;
}
.status-release:hover,
.status-release:focus-visible { background: var(--n-100); }
.release-notes-dialog { max-width: 650px; }
.release-lead { font-size: var(--fs-xl); line-height: 1.55; color: var(--n-800); }
.release-list { display: grid; gap: 10px; padding-left: 22px; color: var(--n-700); line-height: 1.5; }
.release-list strong { color: var(--n-800); }
.inspector {
  background: var(--n-0);
  border-left: 1px solid var(--line);
  overflow: auto;
}
.inspector-title {
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
#inspector-content {
  padding: 23px 20px;
  min-height: 285px;
}
.inspector h2 {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 10px 0 7px;
}
.inspector p.hint {
  margin: 0 0 22px;
}
.inspector label,
dialog label {
  display: flex;
  flex-direction: column;
  font-size: var(--fs-xs);
  font-weight: 500;
  gap: 7px;
  margin-bottom: 15px;
}
.inspector input,
.inspector select {
  font-size: var(--fs-sm);
}
.inspector .button-row {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.button-row button {
  flex: 1;
  font-size: var(--fs-xs);
}
.pin-assignment {
  display: flex;
  justify-content: space-between;
  background: var(--wash);
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: var(--fs-2xs) var(--font-mono);
  margin: 14px 0;
}
.io-monitor {
  padding: 23px 20px;
  border-top: 1px solid var(--line);
}
.io-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 40px;
  border-bottom: 1px solid var(--n-50);
  font: var(--fs-2xs) var(--font-mono);
}
.io-row small {
  display: block;
  font: var(--fs-2xs) var(--font-mono);
  color: var(--muted);
  margin-top: 3px;
}
.io-value {
  min-height: 24px;
  padding: 3px 8px;
  font: var(--fs-2xs) var(--font-mono);
  color: var(--n-600);
  border-radius: var(--r-xs);
}
.io-value.on {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-color: var(--ok-line);
}
.hint {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--muted);
}
dialog:not([open]) {
  display: none !important;
}
dialog {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
  width: min(480px, calc(100vw - 28px));
  max-height: 90dvh;
  overflow: auto;
  color: var(--ink);
  box-shadow: var(--sh-3);
}
dialog::backdrop {
  background: color-mix(in srgb, var(--n-850) 40%, transparent);
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.dialog-heading h2 {
  font-size: var(--fs-4xl);
  letter-spacing: -0.7px;
  font-weight: 600;
  margin: 8px 0 0;
}
.dialog-heading > button {
  border: 0;
  background: var(--wash);
  font-size: var(--fs-3xl);
  min-width: 32px;
  padding: 3px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
fieldset {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: var(--r-sm);
}
legend {
  font-size: var(--fs-sm);
  color: var(--muted);
}
dialog .radio-option {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: var(--fs-md);
  cursor: pointer;
}
.radio-option small {
  display: block;
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 5px;
}
.wide-dialog {
  width: min(1000px, calc(100vw - 28px));
}
.board-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 30px;
}
.board-info {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding-right: 25px;
}
.board-info a {
  font-size: var(--fs-sm);
}
.board-pcb {
  background: var(--accent-600);
  color: var(--z-on-dark);
  border: 1px solid var(--accent-700);
  border-radius: var(--r-md);
  padding: 17px 12px;
  margin: 17px 0;
  position: relative;
}
.board-pcb h3 {
  font-size: var(--fs-3xl);
  color: var(--n-0);
  margin: 0 0 6px;
  letter-spacing: 1px;
}
.board-pcb p {
  font: var(--fs-2xs) var(--font-mono);
  opacity: 0.8;
}
.pin-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 16px;
}
.pin {
  font: var(--fs-2xs) var(--font-mono);
  background: var(--accent-700);
  color: var(--z-muted-dark);
  border: 1px solid var(--accent-400);
  border-radius: var(--r-xs);
  padding: 6px 0;
  text-align: center;
}
.pin.used {
  background: var(--warn-line);
  color: var(--ok-ink);
  border-color: var(--warn-line);
}
.pin.reserved {
  opacity: 0.45;
}
.board-chip {
  border: 2px solid var(--accent-400);
  margin: 18px auto 10px;
  padding: 12px;
  text-align: center;
  width: max-content;
  font: var(--fs-2xs) var(--font-mono);
  background: var(--accent-700);
}
.table-scroll {
  overflow: auto;
}
.mapping-area {
  min-width: 0;
}
.mapping-area table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-sm);
}
.mapping-area th {
  text-align: left;
  font: var(--fs-2xs) var(--font-mono);
  color: var(--muted);
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.mapping-area td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--n-100);
}
.mapping-area input {
  min-width: 90px;
  font: var(--fs-xs) var(--font-mono);
  padding: 7px;
}
.mapping-area td:nth-child(2) input {
  min-width: 125px;
}
.mapping-area select {
  min-width: 80px;
  font: var(--fs-xs) var(--font-mono);
}
.mapping-area td button {
  border: 0;
  padding: 4px 8px;
}
.error {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--fault-ink);
}
.hardware-dialog {
  width: min(660px, calc(100vw - 28px));
}
.connection-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 23px;
}
.connection-methods .radio-option {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
  margin: 0;
  align-items: flex-start;
}
.connection-methods .radio-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}
.port-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 15px;
}
.port-row label {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.port-row button {
  height: 36px;
}
.connection-notice {
  padding: 14px 16px;
  border: 1px solid var(--n-200);
  background: var(--n-50);
  font-size: var(--fs-sm);
  line-height: 1.6;
  border-radius: var(--r-sm);
  margin: 18px 0;
}
details {
  font-size: var(--fs-sm);
  line-height: 1.8;
}
summary {
  font-weight: 600;
  cursor: pointer;
}
details li {
  margin-bottom: 9px;
}
code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--wash);
  padding: 2px 5px;
}
#toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--n-0);
  padding: 13px 20px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-3);
  font-size: var(--fs-sm);
  z-index: 20;
  max-width: 90vw;
}
#toast[hidden] {
  display: none;
}
.recent-item {
  display: flex;
  width: 100%;
  justify-content: space-between;
  white-space: normal;
  margin: 8px 0;
  text-align: left;
}
.recent-item small {
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.plant-viewport {
  flex: 1;
  overflow: auto;
  background: var(--n-50);
}
.plant-viewport #plant-stage {
  position: relative;
  min-width: 700px;
  min-height: 650px;
  height: 100%;
  background-image: radial-gradient(var(--n-300) 1px, transparent 1px);
  background-size: 20px 20px;
  background-repeat: repeat;
}
.animacion-girar {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes belt {
  to {
    background-position: 24px 0;
  }
}
.empty-state {
  padding: 35px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  border: 1px dashed var(--line);
  background: var(--n-0);
}
.empty-state h2 {
  color: var(--ink);
  font-size: var(--fs-2xl);
  font-weight: 500;
}
.inspector .full-width {
  width: 100%;
  margin-top: 12px;
}
@media (min-width: 1600px) {
  .workbench {
    grid-template-columns: 235px minmax(0, 1fr) 290px;
  }
  .ladder-sheet {
    padding: 35px 50px;
  }
  .workspace-content[data-view="split"] {
    flex-direction: row;
  }
  .workspace-content[data-view="split"] .plant-pane {
    border-left: 1px solid var(--line);
    border-top: 0;
  }
}
@media (max-width: 1150px) {
  .workbench {
    grid-template-columns: 180px minmax(0, 1fr) 235px;
  }
  .library-tool {
    gap: 4px;
    padding: 6px;
  }
  .library-symbol {
    width: 48px;
  }
  .edition,
  .connection-summary,
  .project-heading > .eyebrow {
    display: none;
  }
  .topbar {
    gap: 20px;
  }
  .ladder-sheet {
    padding: 23px 16px;
  }
  .canvas-toolbar {
    padding: 0 16px;
  }
  .canvas-toolbar .subtle {
    display: none;
  }
  .project-heading input {
    width: 28vw;
  }
  #inspector-content,
  .io-monitor {
    padding: 20px 15px;
  }
  .workspace-tabs {
    padding: 0 8px;
    gap: 0;
  }
  .workspace-tabs > button {
    padding: 0 9px;
    font-size: var(--fs-xs);
  }
  .statusbar > span:last-child {
    display: none;
  }
}
@media (max-width: 900px) {
  .workbench {
    grid-template-columns: 155px minmax(0, 1fr);
  }
  .inspector {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }
  .inspector-title {
    display: none;
  }
  #inspector-content {
    min-height: 0;
  }
  .app {
    height: auto;
    min-height: 100dvh;
  }
  .workbench {
    min-height: calc(100dvh - 130px);
  }
  .workspace {
    min-height: 580px;
  }
  .sidebar {
    overflow: visible;
  }
  .workspace-content {
    min-height: 420px;
    max-height: 700px;
  }
  .io-monitor {
    border-left: 1px solid var(--line);
    border-top: 0;
  }
  .library-tool {
    font-size: var(--fs-xs);
  }
  .library-symbol {
    font-size: var(--fs-xl);
    width: 42px;
  }
  .section-title .subtle {
    display: none;
  }
  .project-heading {
    gap: 8px;
  }
  .project-heading input {
    width: 32vw;
    font-size: var(--fs-2xl);
  }
  .run-controls > span {
    margin-right: 0;
  }
  .topbar {
    padding: 0 15px;
    gap: 15px;
  }
  .brand strong {
    font-size: var(--fs-2xl);
  }
  .file-actions {
    gap: 0;
  }
  .file-actions kbd {
    display: none;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: auto;
    min-height: 99px;
    flex-wrap: wrap;
    padding: 14px;
    gap: 10px;
  }
  .topbar .brand {
    flex: 1;
  }
  .file-actions {
    order: 3;
    width: 100%;
    border-top: 1px solid var(--n-700);
    padding-top: 8px;
  }
  .topbar button {
    min-height: 30px;
  }
  .project-heading {
    width: 100%;
  }
  .project-heading input {
    width: auto;
    flex: 1;
    max-width: 72%;
    font-size: var(--fs-2xl);
  }
  .project-heading #save-state {
    font-size: var(--fs-2xs);
  }
  .run-controls {
    width: 100%;
    justify-content: flex-end;
  }
  .run-controls > span {
    margin-right: auto;
  }
  .workbench {
    display: flex;
    flex-wrap: wrap;
  }
  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .library-section > .section-title {
    display: none;
  }
  .library-section {
    padding: 8px;
    border: 0;
    overflow: auto;
  }
  #library {
    display: flex;
    gap: 5px;
    width: max-content;
  }
  .library-tool {
    width: auto;
    min-height: 40px;
    flex-direction: column;
    gap: 2px;
    padding: 4px 10px;
    font-size: var(--fs-2xs);
    border-color: var(--line);
    background: var(--n-0);
  }
  .library-symbol {
    font-size: var(--fs-xl);
    width: auto;
  }
  .workspace {
    width: 100%;
    min-height: 470px;
  }
  .workspace-tabs {
    height: 44px;
    padding: 0 8px;
  }
  .workspace-content {
    min-height: 360px;
    max-height: 600px;
  }
  .ladder-sheet {
    padding: 20px 12px;
  }
  .canvas-toolbar {
    padding: 0 12px;
    gap: 7px;
  }
  .canvas-toolbar .button {
    font-size: var(--fs-2xs);
    padding: 5px;
  }
  .canvas-toolbar select {
    max-width: 135px;
    font-size: var(--fs-xs);
  }
  .canvas-toolbar strong {
    font-size: var(--fs-xs);
  }
  .inspector {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .io-monitor {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .inspector label {
    max-width: 100%;
  }
  .inspector .button-row {
    max-width: 100%;
  }
  .board-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .board-info {
    border-right: 0;
    padding: 0;
  }
  .board-pcb {
    max-width: 280px;
  }
  .wide-dialog,
  dialog {
    padding: 20px;
  }
  .dialog-heading h2 {
    font-size: var(--fs-3xl);
  }
  .connection-methods {
    grid-template-columns: 1fr;
  }
  .port-row {
    align-items: stretch;
    flex-direction: column;
  }
  .statusbar {
    padding: 9px 12px;
    font-size: var(--fs-2xs);
  }
  .history-controls {
    gap: 0;
  }
  .history-controls button {
    width: 25px;
  }
  .rung-block,
  .add-rung-bottom,
  .sheet-heading {
    min-width: 460px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
[hidden] {
  display: none !important;
}
.input-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  flex-shrink: 0;
  align-self: flex-start;
}
.branch-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 105px;
}
.branch-tail {
  min-width: 26px;
  flex: 1;
}
.branch-parallel {
  position: relative;
  margin-top: -52.5px;
  padding-top: 52.5px;
}
.branch-parallel:before,
.branch-parallel:after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 52.5px;
  width: 2px;
  background: var(--n-400);
}
.branch-parallel:before {
  left: 0;
}
.branch-parallel:after {
  right: 0;
}
.branch-path {
  display: flex;
  align-items: center;
  position: relative;
  height: 105px;
}
.branch-path:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--n-400);
}
.has-parallel {
  align-items: flex-start;
}
.has-parallel:before {
  top: 52.5px;
}
.has-parallel > .ladder-cell {
  margin-top: 8.5px;
}
.has-parallel > .drop-slot {
  margin-top: 17.5px;
}
.has-parallel .branch-main > .ladder-cell {
  z-index: 3;
}
.has-parallel .branch-main > .drop-slot {
  z-index: 4;
}
