.bldcSettings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 185px;
  gap: 20px;
  align-items: center;
  margin: 16px 0;
}

.bldcSettings output {
  float: right;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.bldcSettings input {
  display: block;
  width: 100%;
  padding: 0;
  margin: 12px 0 0;
}

.bldcSettings select {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.bldcActions,
.limitActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

#arm {
  display: none;
}

#runStatus {
  margin: 10px 0;
}

progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}

.ledStatus {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.ledStatus i {
  width: 12px;
  height: 12px;
  border: 1px solid #0003;
  border-radius: 50%;
  background: #64748b;
}

.powerSteps,
.download {
  display: block;
  margin: 12px 0;
}

.ledGuide,
.faultEvents {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.ledGuide p {
  margin-top: 8px;
}

.chart {
  height: 220px;
}

.arrowPanel {
  margin-bottom: 12px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border);
}

.arrows {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 48px);
  justify-content: center;
  gap: 5px;
  margin: 6px 0 12px;
}

.arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-size: 22px;
  touch-action: none;
  user-select: none;
}

.arrow small { font-size: 9px; }
.arrow.up { grid-column: 2; }
.arrow.left { grid-column: 1; grid-row: 2; }
.arrow.down { grid-column: 2; grid-row: 2; }
.arrow.right { grid-column: 3; grid-row: 2; }

.arrow.engaged:enabled,
.arrow.engaged:enabled:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.arrowPanel h2,
.arrowPanel .hint {
  display: none;
}

#arrowHint {
  text-align: center;
  font-size: 12px;
}

.voltageRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}

.voltageRow select {
  flex: 1;
}

.poleSetting {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 0 8px;
  font-size: 12px;
}

.poleSetting select {
  padding: 3px 5px;
  font-size: 12px;
}

.limitsPanel {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.limitsPanel table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.limitsPanel th,
.limitsPanel td {
  padding: 5px 2px;
}

.limitsPanel th {
  text-align: left;
  color: var(--muted);
}

.limitsPanel input[type="number"],
.limitsPanel select {
  width: 60px;
  padding: 4px;
  font-size: 12px;
}

.limitsPanel td label,
.ignoreAll {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.limitsPanel td label {
  justify-content: space-between;
  margin: 2px 0;
}

.limitsPanel .hint {
  margin-top: 6px;
}

.faultToasts {
  position: fixed;
  z-index: 1000;
  top: 18px;
  right: 18px;
  width: min(390px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.faultToast {
  position: relative;
  padding: 13px 36px 13px 14px;
  border: 1px solid #fcd34d;
  border-left: 4px solid var(--warning);
  border-radius: 8px;
  background: #fffbeb;
  box-shadow: 0 8px 24px #0f172a1a;
  font-size: 13px;
  pointer-events: auto;
}

.faultToast.stopped {
  border-color: #fecaca;
  border-left-color: var(--danger);
  background: #fef2f2;
}

.faultToast strong,
.faultEvents li strong {
  display: block;
  margin-bottom: 5px;
}

.faultToast div,
.faultEvents li div {
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.faultToast button {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-color: transparent;
  background: transparent;
  font-size: 20px;
}

.faultEvents ol {
  max-height: 280px;
  overflow: auto;
  padding-left: 20px;
  font-size: 13px;
}

.faultEvents li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 540px) {
  .bldcSettings {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
