.routine-steps-field {
  min-width: 0;
  margin: 20px 0;
  padding: 0;
  border: 0;
}

.routine-steps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.routine-steps-head > div {
  display: grid;
  gap: 3px;
}

.routine-steps-head > div > strong {
  font-size: 14px;
}

.routine-steps-head button {
  flex: 0 0 auto;
  padding: 9px 14px;
}

.routine-step-editor {
  display: grid;
  gap: 10px;
  max-height: min(46vh, 430px);
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
}

.routine-step-edit-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 88%, var(--soft));
}

.routine-step-edit-row label {
  margin: 0;
  font-size: 12px;
}

.routine-step-edit-row input {
  padding: 10px 11px;
  background: var(--paper);
}

.routine-step-number {
  align-self: center;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
}

.routine-step-controls {
  display: flex;
  gap: 4px;
  padding-bottom: 3px;
}

.routine-step-controls button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.routine-step-controls button:last-child {
  color: var(--accent);
  font-size: 20px;
}

.routine-step-controls button:disabled {
  opacity: .3;
  cursor: default;
}

@media (max-width: 620px) {
  .routine-steps-head {
    align-items: stretch;
    flex-direction: column;
  }

  .routine-step-edit-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .routine-step-edit-row label:nth-of-type(2) {
    grid-column: 2 / -1;
  }

  .routine-step-controls {
    grid-column: 3;
    grid-row: 1;
  }
}
